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

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.) 

myBunny unknownBunny Bunny Object in Memory carrots. 12 hasFurryTail() eat Dinner ()

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.

myBunny unknownBunny Bunny Object in Memory carrots. 12 hasFurryTail() eat Dinner ()

Step by Step Solution

3.49 Rating (172 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Based on the diagram and the assumptions provided lets evaluate each statement A The reference type of unknownBunny must be Bunny or a supertype of Bu... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Oracle Questions!