Friday, December 9, 2011

Java abstract classes

Pretty basic stuff, but nicely explained:

In Java:
- Abstract classes have one or more abstract method.
- Cannot be instantiated, but can:
  - Have a constructor (callable from subclasses using super()).
  - Be referenced (Figure f = new Rectangle()).
- Subclasses of abstract classes (Rectangle extends Figure) must implement the abstract methods or must themselves be abstract.

Read the tutorial:

No comments:

Post a Comment