taylorialcom/ ObjectOriented

Interfaces

An interface declares a set of behaviors. A class can chose to advertise that it implements the interface. Any class that makes this claim, must implement all methods declared in the interface.1

Interfaces

String word = new String("nonsense");
CharSequence charSeq = word;

Java Collections Framework

1

Actually, the class could be an abstract class and declare a method abstract, and then not bother to implement it. Alternatively, the class could provide a really bad implementation, but we'll leave these comments as a footnote.