Write a program in Java using Bluej that performs the following tasks: i. Creates an abstract class called PolygonFigure
Posted: Fri May 20, 2022 10:08 am
Write a program in Java using Bluej that performs the
following tasks:
i. Creates an abstract class called PolygonFigure having
fileds side1, side2, and a method display() that displays the
fields.
ii. Add an abstract methodcalled area() in the class
PolygonFigure which returns a double value.
iii. Creates a subclass called Rectangle and Square of
the PolygonFigure class.
iv. Use super keyword to pass the parameters from
subclass to superclass constructor to initialize the superclass
fields.
v. Implement the area() method in the subclass Rectangle
and Square to find the area of rectangle and square respectively.
Use superclass reference variable to call the subclass versions of
area() method.
Important notes before solving the
question:------------------------------------------------------------------------------
Please solve in the BlueJ program, not in the Java
Online program.
Also, I don't know how to use the BlueJ program, so
please tell me in detail how to open it, how to choose the type of
class and how the program runs.
Please solve and write the steps in detail with
screenshots.
If you will ignore my comment, you can leave
the question to another expert to
solve.
following tasks:
i. Creates an abstract class called PolygonFigure having
fileds side1, side2, and a method display() that displays the
fields.
ii. Add an abstract methodcalled area() in the class
PolygonFigure which returns a double value.
iii. Creates a subclass called Rectangle and Square of
the PolygonFigure class.
iv. Use super keyword to pass the parameters from
subclass to superclass constructor to initialize the superclass
fields.
v. Implement the area() method in the subclass Rectangle
and Square to find the area of rectangle and square respectively.
Use superclass reference variable to call the subclass versions of
area() method.
Important notes before solving the
question:------------------------------------------------------------------------------
Please solve in the BlueJ program, not in the Java
Online program.
Also, I don't know how to use the BlueJ program, so
please tell me in detail how to open it, how to choose the type of
class and how the program runs.
Please solve and write the steps in detail with
screenshots.
If you will ignore my comment, you can leave
the question to another expert to
solve.