Menu

[solved] – Question 95965

a.Write a program to define a class Shape with data members row and column. The superclass has a constructor that used to set row and column and method rectangle() with access specifier ‘protected’ which used to display the shape of rectangle.
b.Create a class ShapeTriangle that inherits from class Shape by implement keyword ‘extends’. This class has a constructor that make a call to superclass constructor by using keyword super() and a method triangle() that display the shape of triangle.

Expert Answer


OR


Leave a Reply

Your email address will not be published. Required fields are marked *