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. The constructor of class A is called and it displays "i from A is 7".
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...
When a link-local address is created on an IPv6 device, it always has the prefix ________
A) FE::/8 B) FFFE::/10 C) FE80::/10 D) FEFE::/10
____________________ selectors define properties for all instances of an element that occur within a defined container.
Fill in the blank(s) with the appropriate word(s).
Choose equivalent command with =VLOOKUP(1,A2:C10,2)
a. =VLOOKUP(1,A2:C10,,TRUE) b. =VLOOKUP(1,A2:C10,,FALSE) c. =VLOOKUP(1,A2:C10,2,TRUE) d. =VLOOKUP(1,A2:C10,2,FALSE)
The most common type of keyboard is the standard ________ format
Fill in the blank(s) with correct word