Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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() methodStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started