Currently Im studying for SCJP.I have a little confusion regarding method overloading.Some people say that method overloading implements a form of polymorphism.But others say that it doesnt implement any kind of polymorphism.I would be grateful if anybody clarify this issue.
Also i have another thing to ask.in my opinion,a program written in java will take more time to execute than the same program written in C++. Am i correct?
I tried to resolve this issue for myself some time back and my conclusion was that there is no generally accepted definition of whether or not overloading constitutes polymorphism. Some claim that this is static polymorphism while the other form of calling the correctly overridden method depending on the type of pointer (oops, reference) as dynamic or runtime polymorphism. I guess it depends on how you look at it. I don't think that the SCJP exam will actually ask if overloading is a form of polymorphism. Sashi
Yep java often take more time to execute a prog thn the same prog in C++.it's all because in java 1st the prog gets changd in bytecodes thn in source code,thus this conversion thing takes up some time. but thats for runnig in any platform unlike C++. so choice is urs
Thanks for everybody who replied me.Actually it was my 1st post of this forum.Thank you very much for all of you once again.
What Sashi said is almost correct.Because it was my early opinion too. I'm a BIT (Bachelor of IT) undergraduate.When i was doing java as a subject of BIT, our lecturer said that method 0verloading is static/compiletime ploymorphism and Method overriding is dynamic/runtime polymorphism.But now I'm following SCJP course and Lecturer of SCJP course said that Overloading is not polymorphism.Thats why i posted this question to the forum. I really know that they never ask the relationship between polymorphism and overloading in SCJP exam.But having one clear concept in our mind is better than having hundreds of confusions...I think all of u agree with me... I'm also a member of java.sun.com's java forum and no clear and definate answer is not found from that forum. Some said its polymorphism and some said no.
OK thanks for helping ...
Im going to do SCJP 5.0 If anybody can give me some mock tests+study guides..I would be grateful.