• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Method Overloading

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello friends,

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?

*Regards*
VIRAJ
viraj4bit@gmail.com
 
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
polymorphisam is same thing existing in differnt forms,method overloading is definetly implementing it because depending on the type,order of the parameters corresponding function is called.

java may take more time than c++,but we can turn off one option that is just in time to execute faster.
 
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 284
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Khp Virajith
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Friends,

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.

HAVE A NICE DAY.
Regards*
VIRAJ
viraj4bit@gmail.com
 
reply
    Bookmark Topic Watch Topic
  • New Topic