Inheritance, Task 1 ------------------- 1) Animal is the superclass, and Cat is the subclass. When a subclass inherits the fields and methods of its superclass, it does not have to re-define those fields and methods. For example, since Cat extends Animal, it inherits all of Animal's methods. Therefore, without writing any methods inside of Cat.java, we could write the following: Cat c = new Cat(...); System.out.println(c.getName()); // since getName() is inherited from Animal 2) A subclass cannot directly access the inherited fields because they are private members of the superclass. 3-5) See the separate Cat.java solution file. 6) It should extend Cat, because Abyssinians a type/subclass of cat. 7) See the separate Abyssinian.java solution file 9) a) a.getNumLegs() will compile. The Animal version of the method will be called, because that version is inherited by Cat and not overriden, and then it is inherited by Abyssinian and not overriden. b) a.isExtroverted() will compile. The Abyssinian version of the method will be called, because although there is a version of the method inherited from Cat, it is overriden by a new version in Abyssinian. c) a.isSleeping() will compile. The Cat version of the method will be called, because although there is a version of the method in Animal that is inherited by Cat, it is overriden by a new version in Cat, and the Abyssinian inherits that version from Cat and does not override it. d) a.isSmall() will *not* compile. The only version of this method is in the Dog class, and Dog is not a superclass of Abyssinian, and thus Abyssinian does not inherit the method. e) a.toString() will compile. The Cat version of the method will be called, because although there is a version of the method in Animal that is inherited by Cat, it is overriden by a new version in Cat, and the Abyssinian inherits that version from Cat and does not override it. f) a.equals(a) will compile. None of these classes define their own equals() method, so the one inherited from the Object class will be called.