Question
Rule 1: An object of a class can be referenced by a variable of the class type OR any of the class ancestor class types
Rule 1:An object of a class can be referenced by a variable of the class type OR any of the class ancestor class types OR of the type of an Interface it implements.
Rule 2:Java only permits the methods of a reference variables class to be invoked on that variable
Rule 3:When an object and its reference variable have different class types, and a method that is in both classes in invoked on the object, the method of the objects class is selected for execution.
5. Of the three Rules presented in the pre-reading material which of the following make upcasting possible? Select one: a. Rule 1 b. Rule 2 c. Rule 3 d. Rule 1 and 2 e. Rule 2 and 3 f. Rule 1 and 3 g. Rule 1,2 and 3
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started