+ 1
Objects vs Instances
Upcasting: You can cast an instance of a subclass to its superclass. Downcasting: Casting an object of a superclass to its subclass is called downcasting. Why did the upcasting definition use the word "instance" and the downcasting definition use the word "object"? Are they supposed to mean different things?
2 Antworten
+ 8
Object means the definition, instance is the object after instantiating the properties of it (after setting values to the attributes of an object). But I think these two terms are mixed up so often, that noone will care about using them as synonyms.
+ 8
check this post
https://www.sololearn.com/Discuss/233285/?ref=app