Question: Create a java class named Shape with a method to print is shape. then create two other classes named 'rectangle', 'Circle', inheriting the shape

Create a java class named Shape with a method to print " is shape". then create two other classes named 'rectangle', 'Circle', inheriting the shape class, both having a method to print "This is a rectangular shape" and "This is circular shape" respectively. Create a subclass 'Square' of 'Rectangle' having a method to print "Square is a rectangle". Now call the method of 'Shape' and 'Rectangle' class by the object of 'Square' class.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!