Suppose that Fruit Apple Orange GoldenDelicious and Macintos
Solution
1. No, fruit is not an instance of Apple because it is an instance of its super class Fruit so it will create a type conversion error and moreover this object will not be able to access the method of Apple class.
2. No, fruit is not instance of Orange because fruit is an instance of Fruit class and moreover, Apple and Orange are different classes. So, an instance of Fruit class cannot be an instance of Orange class.
3. No, fruit cannot be an instance of Macintosh because Fruit and Macintosh are different classes. So, an instance of Fruit class cannot be an instance of Macintosh class.
4. Yes, orange is an instance of Fruit because orange is an instance of Fruit\'s child class Orange. So, an instance of Orange class automatically becomes an instance of Fruit class.
5. No, orange is not an instance of Apple because it is an instance of Orange class and moreover Apple and Orange are different classes. So, an instance of Orangle class cannot be an instance of Apple class.
6.No, it cannot invoke this method because it is an instance of Fruit class and an instance created from super class cannot access the methods of its child classes. So, an instance of Fruit class will not be able to access makeAppleCider function of Apple class.
7. Yes, an instance of Orange class will invoke the method makeOrangeJuice method of Orange class. No, fruit cannot invoke this method because it is an instance of Fruit class and both Fruit and Orange are different classes and moreover an instance created from super class cannot access the methods of its child classes, so it will not be able to access the makeOrangeJuice method of Orange class.
8. No, it is not legal because both Apple and Orange are different classes.
9. No, it is not legal because it is not possible to create an instance of child class from its super class which will generate an error. So, the declaration is not legal.
10. Yes, the declaration is legal because we can create an instance of super class from its child class which will not create any error. So, the declaration is legal.
