First of all thanks and yes its helpful a litle bit...im confused because i have a belief that compile time polymorphism is achieved by method overloading.
But Head First Java says that overloading methods has nothing to do with polymorphism!!!
I think now i am more claer about my confusion...
I knwo there are people who disagree, but I think Head First is correct to say polymorphism requires overriding. That also means that the only thing which can be polymorhpic is the only thing which can be overridden, which is a non‑private non‑final instance method.
Vineet Tyagi wrote:I have read in many books that overloading is a type of polymorphism.
Ooops. Mis-read the question. I was talking about method overriding.
In my view: No. Method overloading is NOT a form of polymorphism. You'll sometimes see it referred to as 'static polymorphism', which makes absolutely no sense to me at all, since the term is an oxymoron.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
I also think that overloading method is not a type of polymorphism. A polymorphism is an ability of an object to take many forms and as I remember in headfirst, objects are blueprint of a class and object must have state and behavior but overloading methods are only behavior.