Question OOP-POLY-0059
MediumWhy is downcasting (base to derived) risky?
- A.
It deletes the object
- B.
The object might not really be of the derived type, causing a ClassCastException or undefined behaviour
- C.
It changes the object's class permanently
- D.
It is always a compile error
Sign up free to see the answer and a step-by-step explanation.