The following diagram shows two reference variables pointing to the same Bunny object in memory. The reference
Question:
The following diagram shows two reference variables pointing to the same Bunny object in memory. The reference variable myBunny is of type Bunny, while unknownBunny is a valid but unknown data type. Which statements about the reference variables are true? Assume the instance methods and variables shown in the diagram are marked public. (Choose three.)
A. The reference type of unknownBunny must be Bunny or a supertype of Bunny.
B. The reference type of unknownBunny cannot be cast to a reference type of Bunny.
C. The reference type of unknownBunny must be Bunny or a subclass of Bunny.
D. If the reference type of unknownBunny is Bunny, it has access to all of the same methods and variables as myBunny.
E. The reference type of unknownBunny could be an interface, class, or abstract class.
F. If the reference type of unknownBunny is Object, it has access to all of the same methods and variables as myBunny without a cast.
Step by Step Answer:
OCP Oracle Certified Professional Java SE 11 Developer Practice Tests Exam 1Z0 819 And Upgrade Exam 1Z0 817
ISBN: 9781119696131
1st Edition
Authors: Scott Selikoff, Jeanne Boyarsky