When are the object type known for upcasting the objects?

When are the object type known for upcasting the objects?
A. Compile time
B. Runtime
C. Source code build time
D. Doesn’t apply to objects directly
 
Answer: b
Explanation: The upcasting with objects directly requires runtime resolving. The objects are fixed and address are allocated at compile time. But the execution of a program requires runtime knowledge of object types, for implicit type cast.
 

Tìm kiếm

Back
Top