i. Every Class extends Object
ii. Override methods
1. equals(Object o), toString()
iii. instanceof
i. Definition – a contract between interface and
implementing classes
ii. Defining
1. Syntax
2. Interface type
3. Abstract methods
4. static final constants
iii. Using
1. class implements interface
2. Include all methods
3. Code or stub
i. http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Comparable.html
i. For instance, if you add another method, that
will break existing code, since it won’t implement that method.
i. Note: not just –1 and 1. Can be any negative or positive values
i. Just like ArrayList
public Class <className> implements
Comparable<ClassType> {}
public int compareTo(<ClassType> other){
if (a) {return –1}…}