Solved

Need an example of polymorphism

Posted on 2007-11-23
9
3,493 Views
Last Modified: 2010-08-05
Hi All,

Can you give me a real world example of polymorphism ?

Thanks
0
Comment
Question by:pentiumnewbie
  • 4
  • 2
9 Comments
 
LVL 35

Accepted Solution

by:
TimYates earned 125 total points
ID: 20337962
0
 

Author Comment

by:pentiumnewbie
ID: 20338213

If id wanted a wikipedia explanation I would have went there myself....
0
 
LVL 35

Expert Comment

by:TimYates
ID: 20338234
Well why didn't you then?

What exactly were you expecting for such a basic question?

Surely a peer-reviewed wikipedia example is better than something we pull out of our hats?

Tim
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 35

Expert Comment

by:TimYates
ID: 20338320
Sorry, that came out grumpier than I wanted it to...

Can you explain exactly what it is you are looking for?
0
 
LVL 9

Assisted Solution

by:ysnky
ysnky earned 125 total points
ID: 20338548
briefly polymorphism is  implementing the same method depends on object.

a simple  sample;

public interface Person () {
  public void speak();
}

public TurkishPerson implements Person {
  public void speak() {
    System.out.println("merhabe");
 }
}

public EnglishPerson  implements Person {
  public void speak() {
    System.out.println("hello");
 }
}
0
 
LVL 35

Expert Comment

by:TimYates
ID: 20338669
I guess most OO code exhibits polymorphism is some way or other...

GUI frameworks especially...
0
 

Author Comment

by:pentiumnewbie
ID: 20339153

Sorry Tim, just wondering if you can give me an example of you used it.

Thanks again
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
hash value 2 39
count8 challlenge 13 87
pairstar challenge 2 42
maven java path setting 5 50
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
The viewer will learn how to implement Singleton Design Pattern in Java.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now