Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

/ / - - - - - - - - - - - - - - - - - - - - - - -

//-------------------------------------------------------------
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions