+ 2
DownCasting in Class
Can Someone explain me? I am getting confused with it. also, explain me the scenarios where we can use downcasting.
2 Respostas
+ 1
I am having similar issue understanding downcast
+ 1
i can explain this . when u cast a decimal number to integer it store in int variable type and the decimal point of previously preseneted vanishes and it is treated as integer. similarly in down casting when a object is created of subclass using casting of superclass then the object is treated as a type superclass not the subclass