Next: Exceptions
Up: Interfaces
Previous: Marker Interfaces
Contents
Subsections
- Interfaces provide a form of multiple inheritance. A class can extend only one other class.
- Interfaces are limited to public methods and constants with no implementation. Abstract classes can have a partial implementation, protected parts, static methods, etc.
- These two differences usually direct the choice.
- If multiple inheritance is important or even useful interfaces are used.
- Abstract class lets you define some or all of the implementation.
- Any major class you expect to be extended should be an implementation of an interface.
Next: Exceptions
Up: Interfaces
Previous: Marker Interfaces
Contents