CS 101 (Fall 2002)
Lecture 30
Abstract Classes

An abstract class is a Java class that leaves some method-bodies undefined. The API for the method is present in the abstract class, but no implementation is given. Example:

  public abstract class Foo {
     public boolean concrete1() { return true; }
     public int     concrete2() { return 5;    }
     public abstract String abstract1() ;
     public abstract Rect   abstract2(int size) ;
The concrete1 and concrete2 methods are concrete, as their definitions are provided in Foo. However, no method definitions are given for abstract1 or abstract2.