So, i give you an example what this type of type-casting will effect the data and that's why it's prohibited.
Animal class will have attributes say, name, gender, color, cast,origin, type etc.
Cat...
Type: Posts; User: Mr.777
So, i give you an example what this type of type-casting will effect the data and that's why it's prohibited.
Animal class will have attributes say, name, gender, color, cast,origin, type etc.
Cat...
Agree with Junky. One more thing, downcasting is only allowed if it will be succeeded at compile time. If it can't even succeded at compile time, it definitely means that you are going to downcast an...