Tuesday, April 24, 2018

Polymorphism is starting to make sense...

I'm about 65% of the way through a Java course via StackSkills and polymorphism is starting to make sense.

One of the slides from the course taught me the following;

A superclass type can always be cast to the type of one of its subclasses. This is called “downcasting”.

The ultimate root class in Java is Object. An object of type Object can be downcast to any type (class) that descends from Object.


The ability of a class to be cast to the type of one of its subclasses or descendants is terms polymorphism.

No comments:

Post a Comment

SQL

I've hit a wall in my SQL studies via the Khan Academy, and as such, I am engaging in additional studies prior to attempting to move for...