Analyze the following code:
```
public class Test {
public static void main(String[] args) {
new B();
}
}
class A {
int i = 7;
public A() {
System.out.println("i from A is " + i);
}
public void setI(int i) {
this.i = 2 * i;
}
}
class B extends A {
public B() {
setI(20);
// System.out.println("i from B is " + i);
}
@Override
public void setI(int i) {
this.i = 3 * i;
}
}```
a. The constructor of class A is not called.
b. The constructor of class A is called and it displays "i from A is 7".
c. The constructor of class A is called and it displays "i from A is 40".
d. The constructor of class A is called and it displays "i from A is 60".
b When invoking new B(), B's superclass A's constructor is invoked first. So it displays i from A is 7.
You might also like to view...
In the classic pattern for ____-state behavior, an object can switch from one state to another.
A. one B. two C. three D. four
If a CheckBox is “on” (checked), its __________ property is True; otherwise, it’s False (“off”).
a) Selected b) On c) Chosen d) Checked
What fraction of state legislators around the country would be required to ratify a Constitutional amendment in order for it to pass?
What will be an ideal response?
Give four examples of common help desk performance measures.
What will be an ideal response?