Question: //create an abstract Shape class abstract class Shape { static int shapeCount = 0; public Shape() { //shapeCount is incremented every time a new shape
//create an abstract Shape class abstract class Shape { static int shapeCount = 0; public Shape() { //shapeCount is incremented every time a new shape is created shapeCount = shapeCount + 1; } //define abstract methods area(), perimeter(), and getShape() abstract double area(); abstract double perimeter(); //getShape() will return a String that represents a particular shape abstract String getShape(); }
Comparable (3 points) 1. Java has a built-in interface called Comparable
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
