Question: Will the following code compile?abstract class A private int x public A ( x = 7 public A ( int y ) { x =

Will the following code compile?abstract class A private int x public A( x =7 public A(int y){ x = y public abstract int do_stuff1) public abstract int do_stuff20 class B extends A { public B( super (7) ; public B (int y){ super(y) ;@Override public int do_stuff1(){ return 4; } @Override public int do_stuff2(){ return 4 ; }} class Main { public static void main (String ] args ){ BmyB = newB(5) ; }}1.- No, class A cannot have a constructor since it's abstract.2.- No, class B can't have a constructor since it's inheriting from an abstract class A.3.- No, you can't use super/base to call a constructor in an abstract class 4.-Yes

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 Programming Questions!