Question: / / - - - - - - - - - - - - - - - - - - - - - - -

//-------------------------------------------------------------
public abstract class ParentClass {
private int f1;
public final int f2=100;
public static int f3;
private void method1(){System.out.println("Method1"); }
public static void method2(){System.out.println("Method2"); }
public abstract void method3();
public ParentClass(){
System.out.println("Parent Constructor");
}
}
//-------------------------------------------------------------
public class ChildClass extends ParentClass{
public int f4=400;
public ChildClass(){
System.out.println("ChildClass: Constructor");
}
public void method3(){
System.out.println("ChildClass: method3 body");
}
}
The code: ChildClass c3= new ParentClass(); is correct.

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!