Abstract vs. concrete classes
how does animal talk?
- animal is abstract concept, abstract class
- we don't have animals, we have types of animals
- abstract class Animal { abstract void talk(); // no body required …}
can only instantiate concrete class
- class is concrete is all methods are concrete
- method is concrete if it is implemented, not abstract
- so… every concrete Animal must implement talk
- this is how compiler knows ((Animal)c).talk(); is valid.