What Is Polymorphism and How It Is Implemented in Java?

This is fundamental question about object oriented design and programming. To answer correctly, you must be clear about the concept of overload and override. To make a perfect answer, you may give an example of how overload and override are used in Java. The following is a sample answer:

“Polymorphism refers to overload and override features in object oriented design. Overload is implemented by define multiple methods with the same name but different arguments. For example, getContractNum(String agencyNum) may overload getContractNum(). Override is implemented by defining the same method with the same signature in the derived class but may execute different functions from the parent class. Override is often used to included more functionalities in the constructors in the derived class.”

Leave a comment

0 Comments.

Leave a Reply


[ Ctrl + Enter ]