Originally posted by Campbell Ritchie:
We usually use polymorphism to mean different binding at run-time, which to all intents and purposes means overridden instance methods. This means different objects can display different behaviour at run-time, even though they were declared as the same type.
You can't override fields or static methods. Those bind at compile-time, so there is no chance of changing behaviour at run-time.
Hi Cambell !
would you just clarify us of what brij garg said !
As nothing in the name "compile time polymorphism". Is that true ?
What do you call, say
you overload a method in the same class.
like :
In the above code i never say / call the method by its name(not distinct) i say that with the parameters to the compiler - identify and resolve yourself the method call to be made based on the parameters supplied.
Compiler resolves that by the technique of compile time polymorphism.
Since, polymorphism applied at compile time.
what do you call this other than calling it compile time polymorphism!
please clarify if am wrong ! - brij
