14 - Sheep throws an Exception when feed with Beef. Introduces "throw"
keyword. Code does not compile intentional to show that subclasses
cannot alter the signature of a member method!!!
15 - Let DisgustingException extend RuntimeException to show the
difference between "checked" and "unchecked" exceptions. Fixes previous
compiler error too!!!
16 - Handle exception with try/catch block to keep MyProgramm from
terminating when Sheep is incorrectly feed with a non-vegetarian Food.
Introduces "try" and "catch" keywords.
18 - Abstract types can declare abstract methods subclasses then are
forced to implement. Introduces "abstract" keyword on member (instead of
class) level
19 - Extend class hierarchy with a type Vegetarian as common base for
Sheep and Cow. Vegetarian defines isVegetarian member method. Sheep and
Cow thus inherit isVegetarian method and do not need to redeclare.
20 - Dog type/class now implements the Interface Omnivore. Mammal checks
if Mammal instance fed is of type Omnivore and only then allows Beef as
Food. Introduces "implements" keywords and concept of (behavior free
marker) Interfaces".
21 - Interfaces can also declare behavior members methods. Compared to
superclasses they cannot provide (default) behavior for this member
methods though.