subject

Create a java application• shape is an abstract class including two private instance variables: height and width, a constructor, set and get methods (height and width must be greater than 0, otherwise throw illegalargumentexception), tostring method, and an abstract method called getarea.• the class rectangle has one private instance variable: color, a constructor, set and get, tostring, and getarea methods.• the class triangle has one private instance variable: classification (for example; equilateral), a constructor, set and get, tostring, and getarea methods.• create a test file named shapetest. create one object from the classes rectangle and triangle. then, create an array of shape references to objects of each subclass in the hierarchy.• then, create an enhanced for loop that processes all the shapes in the array. if the object belongs to class triangle, display a message that the object is a triangle. if the object belongs to class rectangle, display a message that the object is a rectangle.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 13:00
Which one of the following voltages should never be measured directly with a vom? a. 1200 v b. 500 v c. 800 v d. 100v
Answers: 2
question
Computers and Technology, 25.06.2019 01:40
The instantiation of an endpoint in a potential tcp connection is know as
Answers: 1
question
Computers and Technology, 25.06.2019 15:30
What is the function of a computer screen?
Answers: 1
question
Computers and Technology, 26.06.2019 05:20
What is due to the heat generated by the flow of electricity current through the body
Answers: 3
You know the right answer?
Create a java application• shape is an abstract class including two private instance variables: hei...
Questions
question
Health, 07.07.2019 00:30
question
Spanish, 07.07.2019 00:30
question
Physics, 07.07.2019 00:30
Questions on the website: 13722363