Question: Create a Bitbucket private repository. Name it CUS1156_Lab2. Clone it in your local java Eclipse workspace. You will add the java files after you have

Create a Bitbucket private repository.

Name it CUS1156_Lab2. Clone it in your local java Eclipse workspace. You will add the java files after you have completed them in Part 1 and Part 2 to this location. Part 1: Abstract classes From class, an abstract class represents some generic concept. Subclasses then provide their own specific implementations of any abstract methods of the abstract class.

1. Implement an abstract class called Shape it was discussed in the lecture. Include an abstract method double area() that returns the area of the shape.

2. Implement concrete subclasses of Shape that represents a square and a circle. Implement the area() abstract method in each of these two subclass Include any accessor methods (i.e. get methods) needed and a toString() method in each subclass.

3. Control classes contain a main method. Write a test control class that tests these classes by setting up an array of shapes and initializing each element of the array to a different shape, either a circle or a square. Then print out the details of each shape, including its class (see getClass() method at Object level) and the area of the shape.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!