
212 JAVA Programming
Aircrafts can fly 40000 feets with 2 wings
Crows can fly 1000 feets with 2 wings and without using its 2 legs
The interesting part in this application is the ability of the interface Flyable that represents com-
mon behaviours across multiple-class hierarchies. For instance, the class Aircraft belongs to one class
hierarchy, whereas the class Crow belongs to another class hierarchy namely Bird. Thus, interfaces
are something like bridges that represent the commonalities in multiple-class hierarchies, whereas
abstract classes capture generalization in a single-class hierarchy.
7.4 JAVA ENUMS
Enum, introduced in Java 1.5, is one ...