Solved

Need an example of polymorphism

Posted on 2007-11-23
9
3,497 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Error with Java/Cache JDBC Classpath 2 30
Java Server Faces parameter pass? 6 37
Java SE 8u111  Lot of stuff broke 11 52
servlet example issue 6 27
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 …
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

943 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

6 Experts available now in Live!

Get 1:1 Help Now