7.4. Polymorphism
Polymorphism is Greek for “many shapes.” There are two main aspects of Java that make the language polymorphic: overloading and overriding. They both define different ways of referring to the different methods that use the same name. This sounds rather complicated, but it is really rather straightforward.
Java is not the only language that implements polymorphism. This is an aspect of numerous object-oriented languages. The concepts are difficult to explain without reference to other advanced concepts we have not covered yet. So if you find this a bit confusing, try the examples and keep reading, and then reread this section later.
7.4.1. Overloading
Overloading a method means using the same name for more than one method in ...
Get Java™ for ColdFusion® Developers now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.