Question: Identify and correct errors. If there are no error just write correct. For questions 1 6 , consider the following two classes C , D

Identify and correct errors. If there are no error just write correct.
For questions 16, consider the following two classes C, D, and interface I
public abstract class C {
private void foo1(){
System.out.println("Hello foo1");
}
public abstract void foo2();
public abstract int foo3();
}
public class D extends C {
public void foo2(){
System.out.println("Hello foo2()");
}
public int foo3(){
return 10;
}
private void foo4(){
System.out.println("Hello D foo4()");
}
}
1. C c = new C();
2. D d1= new D();
d1.foo1();
3. C c2;
c2= new D();
4. public interface J extends I {}
5. public class K { public void foo();}
6. public class E extends D
{
public void foo4();
{
super.foo4();
System.out.println("Hello E foo4()");
}
}

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!