+ 1
Why we use upcasting in java ??
5 Respuestas
+ 1
Upcasting is done automatically by Java.
+ 1
can you elaborate why we use it ??
+ 1
You mean why does Java do it automatically or why there’s a need for Java to do it?
+ 1
Yes,my question is why we use or need upcasting in Java ??
we have also used upcasting in polymorphism ,,,,, why we have used it ??
+ 1
This link will explain it better than I ever will: http://www.cs.utexas.edu/~cannata/cs345/Class%20Notes/14%20Java%20Upcasting%20Downcasting.htm