Answered step by step
Verified Expert Solution
Link Copied!
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 LANGUAGEimage text in transcribed

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

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students explore these related Databases questions