Consider the following class definitions.public class BClass{ private int x; public void set(int a) { x = a; } public void print(){ }}public class DClass extends BClass{ private int y; public void set(int a, int b) { //Postcondition: x = a; y = b; } public void print(){ }}Which of the following is the correct definition of the method set of the class DClass?(i) public void set(int a, int b) { super.set(a); y = b; }(ii) public void set(int a, int b) { x = a;
y = b;
}
A. Only (i)
B. Only (ii)
C. Both (i) and (ii)
D. None of these
Answer: A
Computer Science & Information Technology
You might also like to view...
The ________ is a language tool that displays translations and corresponding definitions
A) Translate pane B) Research pane C) Bilingual Dictionary D) Mini Translator
Computer Science & Information Technology
COGNITIVE ASSESSMENT To what does the term, blogosphere, refer?
A. the software used to create blogs B. individual blogs as opposed to corporate blogs C. the worldwide collection of blogs D. the body of web design knowledge required to establish a blog
Computer Science & Information Technology