Question: Will the following code compile? interface IA { public void do_stuff1(); } abstract class B { public abstract void do_stuff2(); } class C extends B

 Will the following code compile? interface IA { public void do_stuff1();

Will the following code compile?

interface IA { public void do_stuff1(); }

abstract class B {

public abstract void do_stuff2();

}

class C extends B implements IA {

@Override

public void do_stuff1() {

int a=1;

}

@Override

public void do_stuff2() {

int b=1;

}

}

class Main {

public static void main(String[] args) {

C myC = new C();

}

}

No, Class C can't extend one class (B) and implement an interface (1A), it can only do one or the other. No, Class C doesn't correctly override do_stuff2() No, class C cannot be instantiated because it implements an interface. 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 Databases Questions!