Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Need an example of polymorphism

Posted on 2007-11-23
9
Medium Priority
?
3,511 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 500 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 500 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This video teaches viewers about errors in exception handling.
Suggested Courses

926 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