Question: Consider the following class declarations. public class Base { private int myVal; public Base() { myVal = 0; } public Base (int x) { myVal

 Consider the following class declarations. public class Base { private int

Consider the following class declarations.

public class Base { private int myVal;

public Base() { myVal = 0; }

public Base (int x) { myVal = x; } } public class Sub extends Base { public Sub() { super(0); } }

Which of the following statement will NOT compile?

Question 9 options:

A)

Sub s2 = new Sub();

B)

Base s1 = new Sub();

C)

Sub s3 = new Sub(5);

D)

Base b2 = new Base(5);

E)

Base b1 = new Base();

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!