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
Get step-by-step solutions from verified subject matter experts
