Multiple Choice
For the questions below, consider the following class definition:
public class AClass
{
protected int x;
protected int y;
public AClass(int a, int b)
{
x = a;
y = b;
}
public int addEm( )
{
return x + y;
}
public void changeEm( )
{
x++;
y--;
}
public String toString( )
{
return "" + x + " " + y;
}
}
-Consider that you want to extend AClass to BClass. BClass will have a third int instance data, z. Which of the following would best define BClass'constructor?
A) public BClass(int a, int b, int c) {
Super(a, b, c) ;
}
B) public BClass(int a, int b, int c) {
X = a;
Y = b;
Z = c;
}
C) public BClass(int a, int b, int c) {
Z = c;
}
D) public BClass(int a, int b, int c) {
Super(a, b) ;
Z = c;
}
E) public BClass(int a, int b, int c) {
Super( ) ;
}
Correct Answer:

Verified
Correct Answer:
Verified
Q17: A motorcycle inherits properties from both a
Q21: Which of the following is not a
Q23: Explain the difference between implementing an interface
Q31: The reserved word, extends, is used to
Q40: Two children of the same parent class
Q41: Inheritance through an extended (derived) class supports
Q61: In what manners are Timer objects similar
Q66: What methods inherited from Car should SportsCar
Q70: If A, B, Y and Z all
Q71: Using the reserved word, super, one can<br>A)