Solved

Need an example of polymorphism

Posted on 2007-11-23
9
3,501 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
Independent Software Vendors: 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 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
The viewer will learn how to implement Singleton Design Pattern in Java.

685 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