Question: The following code for two classes in the same package does not compile as expected. Why not? Select the one correct statement. public class B1
The following code for two classes in the same package does not compile as expected. Why not?
Select the one correct statement.
public class B1 { private int b; private int c; /** * Constructors for objects of class B1 */ public B1(int b, int c) { this.b = b; } public B1() { } } public class B2 extends B1 { private int c; /** * Constructors for objects of class B2 */ public B2(int a, int b, int c) { super(a); this.c = 0; } public B2() { } } Select one or more:
The argument name in the two-argument constructor of class B1 is the same as the instance variable (b) in class B1.
The 3-argument constructor of class B2 doesn't make use of the argument c to initialise the instance variable c.
There is no single argument constructor in class B1.
The instance variable c in class B1 has not been explicitly initialised in the constructor.
The zero-argument constructor in class B2 does not explicitly invoke the zero-argument constructor in class B1.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
