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 ____ Options button lists error-checking options following the assignment of an invalid formula to a cell.
A. Find Error B. Explain Error C. Fix Error D. Trace Error
Computer Science & Information Technology
Use a(n) ________ chart to compare values across categories
Fill in the blank(s) with the appropriate word(s).
Computer Science & Information Technology
Netflow was developed to do which of the following?
a. Support IPv6. b. Provide data monitoring. c. Bandwidth analysis. d. Acquire IP traffic operational data.
Computer Science & Information Technology
To use different page number formats within the same document, format the preliminary pages and the remainder of the report as separate ____.
A. documents B. pages C. sections D. files
Computer Science & Information Technology