0

Upcasting in OOPS makes runtime polymorphism possible by overriding methods of parent and child classes. Can downcasting in OOPS also be run-time polymorphic in any way?

georgeawg
  • 48,608
  • 13
  • 72
  • 95

1 Answers1

0

runtime polymorphism is made possible by inheritance -- upcasting and downcasting are irrelevant to it (though they are also only possible with inheritance).

Downcasting generally requires runtime polymorphism, as the downcast may succeed or fail based on the runtime type.

Chris Dodd
  • 119,907
  • 13
  • 134
  • 226