An abstract class sits between a regular class and an interface. It can have constructors, instance fields, and fully implemented methods, but it can also declare abstract methods with no body. You mark it with the abstract keyword.
abstract class Shape {
String color;
Shape(String color) {
this.color = color;
}
abstract double area();
void describe() {
System.out.println(color + " shape");
}
}
You cannot create an instance of an abstract class with new Shape(). A subclass must extend it and implement every abstract method before you can instantiate it.