Java concepts, like late binding, method overriding or overloading as well as to wahat point your program is going to allow your mistakes; I mean whether you are going to get a compile or runtime error.
Exercise 1: Calls Dog’s overridden sound method.
Exercise 2: Throws ClassCastException at runtime because v is not an instance of Car.
Exercise 3: Throws ClassCastException at runtime because p is not an instance of Child.
Exercise 4: Fails at runtime (ClassCastException) because obj is not an instance of C.
Exercise 5: Fails at runtime (ClassCastException) because s is not an instance of Circle.
Exercise 6: Throws ClassCastException because a is not an instance of Cat.
Exercise 7: Works because app points to a WashingMachine instance.
Exercise 8: Fails at runtime (ClassCastException) because f is not an instance of Apple.
Exercise 9: Calls the overridden method in Student.