Different forms of polymorphism in java?
-
plzzz explain different forms of polymorphism in java i.e, like runtime,method overloading through polymorphism
-
Answer:
polymorphism means "same thing will exists with different forms" Ex :suppose we need to find volume of circle,rectangle,triangle.etc in a sample program. generally what we need to do is write the code volume for circle,rectangle,triangle in separately. using polymorphism concept we simply write the volume code with different parameter list ect Ex: class a { volume(int a)//for rectangle { --- } volume (int a,intb,intc)//for triangle { -- } volume (string s)//for circle { -- } }end of class A polymorphism are mainly two types static polymorphism(corresponding method will bind at the time of compiling) dynamic polymorphism(corresponding method will bind at the run time) Static polymorphism is used the concept of early binding or we can say compile time binding where as dynamic polymorphism used the concept of late binding or run time binding. method overloading would be an example of static polymorphism whereas overriding would be an example of dynamic polymorphism. B'Coz,in case of overloading,at compile time the compiler knows which method to link to the call . However,it is determined at runtime for dynamic polymorphism.
Kush at Yahoo! Answers Visit the source
Other answers
Polymorphism exists in three distinct forms in Java: 1.Method overloading 2. Method overriding through inheritance 3. Method overriding through the Java interface two types of polymorphism- 1. compile time (method overloading) 2.run time(method overriding)
Aaren
The term homonym means “a word the same as another in sound and spelling but with different meaning.”Polymorphic assignment statements,Polymorphic Parameter Passing,Polymorphic return types these are the forms of polymorphism in java.
Bahiya
Related Q & A:
- How To Fill Scholarship Forms Online?Best solution by adriansd.com
- Do password fields on registration forms need to be masked?Best solution by User Experience
- Why the same font in Java looks different?Best solution by Stack Overflow
- How to Implement Gateway Service something similar to Oracle API gateway Using Java and Java based Open Source frameworks only?Best solution by Quora
- Difference between Java 2 and Java 6?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.