Method overloading should not be confused with ad-hoc polymorphism
a programming language feature that allows values of different data types to be handled using a uniform interface.
Originally posted by Joe Ess:
The first hit I get on Google is the Wikipedia page for method overloading, and it states:
That definition of polymorphism does not exclude using method overloading, but it does not say that method overloading alone is a kind of polymorphism.
Maybe you can cite a source?
Originally posted by Rauhl Roy:
http://home.cogeco.ca/~ve3ll/jatutor5.htm
Least of all when he tells us about the java.lang.Object#copy(java.lang.Object) method. :roll:Originally posted by Joe Ess:
That guy appears to be a math teacher writing a simplified introduction to the Java language. I wouldn't take his one-page introduction as a canonical source.
specialized version of that method
Perform for today. Adapt for tomorrow.
you'll get the B's implementation run
Perform for today. Adapt for tomorrow.
Originally posted by Rahul Shilpakar:
if
A obj = new B();
obj.doSomething(2);[/CODE]
it will run the A's method implementation. Not B's.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Rauhl Roy:
As far as i know a static method can not override the an instance method. so may i know how the static come into picture here. may i know?
Consider Paul's rocket mass heater. |