Chapter 6 |
Which one?
Interface | Abstract class |
---|---|
implements | extends |
does not have constructors | has constructors |
to declare a method, the keyword abstract is optional because all methods of interfaces are abstract by default | the keyword abstract is mandatory to declare a method as an abstract |
method modifiers: public abstract; private, static | method modifiers: no restrictions |
has constants (static final fields) | has constants and instance fields |
can inherit more than one Java interfaces | can implement more than one Java interface, but can inherit only one class |
used when the implementation is unknown | used if we know the implementation partially |
slow approach | fast approach |
Chapter 6 |