Question: Read out the following program that has some missing coding. Also see the output public abstract class Figure { public Figure ( ) { /
Read out the following program that has some missing coding. Also see the output
public abstract class Figure
public Figure
Your code goes here
public abstract void printOnScreen;
public class Rectangle extends Figure
public Rectangle
Your code goes here
a Override
public void printOnScreen
Your code goes here
public class Main
public static void mainString args
Figure fig new Rectangle;
fig.printOnScreen;
Output:
Inside Figure
Inside Rectangle Constructor
Inside printOnScreen method of Rectangle class
In order to print the above outputs to the console, what changes need to be done to your code without
changing anything from the Main class? You should modify those parts only where it is indicated by
your code goes here".
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
