Question: JAVA LANGUAGE In-Class Exercise: Shape-heritance - Create a program that creates at least 3 different shape objects (ie. circles, squares, triangles, etc.), using multiple classes
JAVA LANGUAGE
In-Class Exercise: Shape-heritance - Create a program that creates at least 3 different shape objects (ie. circles, squares, triangles, etc.), using multiple classes in an inheritance model. - Your program should have at least 4 classes (besides Main): 1 superclass and 3 subclasses that inherit from it. - Each super/sub class must have a proper constructor method, with parameters. Subclasses should pass values from their constructor to the superclass' constructor, where appropriate. - Your superclass must have at least 2 properties common to all shapes, and implement a getArea() method (which will be inherited by subclasses). - Each subclass must have at least one shape-specific property and method, as well as implement the getArea() inherited method. (Look up the math!) - Once your super/sub classes are finished, write code in PSVM to instantiate at least one object of each subclass, and call each object's inherited getArea() method
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
