05 October 2010

0 What is Polymorphism in Java OOP?

Polymorphism is a feature that allows one interface to be used for a general class of actions. An operation may exhibit different behavior in different instances. The behavior depends on the types of data used in the operation. It plays an important role in allowing objects having different internal structures to share the same external interface.

        In Java, Polymorphism can be easily explained as the Method Overloading. In fact, Method Overloading is a way to achieve polymorphism.

      Method Overloading the practice of using same method name to denote several different operations.
In the case of Method Overloading any number of functions can have the same name as long as they differ in any one of the following
  • Type of arguments
  • Number of arguments


0 comments:

Feeds Comments

Please give your valuable comments.