Answered step by step
Verified Expert Solution
Question
1 Approved Answer
use java Using your shape class o Add an abstract draw(Graphics g) method to your abstract Shape class Create a Rectangle, Ellipse, and Triangle class
use java
Using your shape class o Add an abstract draw(Graphics g) method to your abstract Shape class Create a Rectangle, Ellipse, and Triangle class that are all extended from an abstract Shape class (given below). Extend the Rectangle class to make a Square class. Extend the Ellipse class to make a Circle class. The shape classes will contain state information for the object to be drawn All the different shapes will need a draw method but each one will be slightly o o All extended classes should also implement a toString method- it is up to o All extended classes should also implement a equals method to compare two o The Circle, Ellipse, Triangle, Square, and Rectangle should have the same number different you how you want to represent the Shape as a String shapes of constructors with the same arguments, in addition to any other fields that are needed to create those shapes To initialize the private instance fields of the Shape class you will need to make calls to the super class constructor. Private fields and methods of a super class are not directly accessible in the subclasses as if you were in the same class Then initialize fields specific to the particular Shape class you are implementingStep 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