what is the use of the reference of parent class to asign sub class object??
Answers
Answered by
0
Answer:
First approach (Referencing using Superclass reference): A reference variable of a superclass can be used to a refer any subclass object derived from that superclass. If the methods are present in SuperClass, but overridden by SubClass, it will be the overridden method that will be executed.
Explanation:
Please give my answer as branilist answer
Answered by
0
First approach (Referencing using Superclass reference): A reference variable of a superclass can be used to a refer any subclass object derived from that superclass. If the methods are present in SuperClass, but overridden by SubClass, it will be the overridden method that will be executed.
I hope it help you..
have a great day ahead
Similar questions