Question: Question 4 Consider the following code snippet: public class Parent { public void display ( ) { System.out.println ( This is the Parent class.
Question
Consider the following code snippet:
public class Parent
public void display
System.out.printlnThis is the Parent class.";
public class Child extends Parent
public void display
super.display;
System.out.printlnThis is the Child class.";
public class Main
public static void mainString args
Child child new Child;
child.display;
What is the output of the above code snippet upon successful execution?
options:
This is the Child class.
This is the Parent class.
This is the Child class.
This is the Parent class.
This is the Parent class.
This is the Child class.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
