Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started