Interfaces
Interfaces
AND INTERFACES
Abstract methods
You can declare an object without defining it:
Person p;
Similarly, you can declare a method without defining it:
public abstract void draw(int size);
Notice that the body of the method is missing
Instead of { and } you just have a semi colon
Every class knows its superclass, but a class doesnt know its
subclasses
You may know that every subclass of Shape has a draw method, but Java doesnt
Possible solutions to the shape problem