Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
Java

Abstract Classes in Java

Define incomplete base classes with abstract methods.

Abstract Classes in Java — a practical guide to Java abstract class with clear examples you can reuse in real projects.

Java Tutorial Series (43/90). Prefer one article? Read the complete Java tutorial.

Short description

Abstract classes can mix concrete methods and abstract methods. They cannot be instantiated directly.

Abstract class

abstract class Shape {
    abstract double area();
}
class Circle extends Shape {
    double r;
    Circle(double r) { this.r = r; }
    double area() { return Math.PI * r * r; }
}

Leave a reply

Your email address will not be published. Required fields are marked *