Solved

Need an example of polymorphism

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

Can you give me a real world example of polymorphism ?

Thanks
0
Comment
Question by:pentiumnewbie
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

752 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