What is polymorphism? Types of polymorphism ? how will u achieve all types of polymorphism?

This question is related to Oracle Interview

Showing Answers 1 - 1 of 1 Answers

samiksc

  • Jan 12th, 2006
 

Polymorphism is different implementations of methods with same signatures in a class hierarchy.

Ploymorphisms may be classified as

  1. Interface based  -- achieved when two classes implement the same interface providing different implementations of the interface methods
  2. Inheritance based -- achieved when a derived class provides a different implementation of a overridable method of a base class.

OR

  1. Compile time polymorphism -- achieved when a derived class overrides a base class method or implements an interface method.
  2. Runtime polymorphism -- achieved when a derived class provides a different implementation of a 'virtual' method of the base class.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions