6.6. Polymorphism

[7.5] Use abstract classes and interfaces

[7.2] Develop code that demonstrates the use of polymorphism; including overriding and object type versus reference type

The literal meaning of the word polymorphism is “many forms.” At the beginning of this chapter, I used a practical example to explain the meaning of polymorphism; the same action may have different meanings for different living beings. The action eat has a different meaning for a fly and a lion. A fly may eat nectar, whereas a lion may eat an antelope. Reacting to the same action in one’s own unique manner in living beings can be compared to polymorphism in Java.

For the exam, you need to know what polymorphism in Java is, why ...

Get OCA Java SE 8 Programmer I Certification Guide 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.