Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Advanced overloading

 
Ranch Hand
Posts: 186
Oracle C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Q. Well m a bit confused about it.., why doStuff(Integer... i) hasnt been called here, though the sa will get autobox to Integer?
 
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi and welcome to the JavaRanch.

Please UseCodeTags when posting code. It will highlight your code and make it much easier to read. It probably will also increase the number of people helping you. I'll add them for you since you are new so that you can see the difference.

I would advice you to read this great topic about this matter. If you are still confused then please ask away.
 
swaraj gupta
Ranch Hand
Posts: 186
Oracle C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi wouter, thanks

m still confused...
initially if both the "sa" parameters have been Autoboxed to Integer then why not the method doStuff(Integer...i) has been invoked here..? Please help.

Wouter Oet wrote:Hi and welcome to the JavaRanch.

Please UseCodeTags when posting code. It will highlight your code and make it much easier to read. It probably will also increase the number of people helping you. I'll add them for you since you are new so that you can see the difference.

I would advice you to read this great topic about this matter. If you are still confused then please ask away.

 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hint: arrays are objects.
 
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

swaraj gupta wrote:
m still confused...
initially if both the "sa" parameters have been Autoboxed to Integer then why not the method doStuff(Integer...i) has been invoked here..? Please help.


Swaraj, Array ia an Object and not an Integer.
<edit>
Wouter beat me by 2 minutes
 
swaraj gupta
Ranch Hand
Posts: 186
Oracle C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks wouter, i got your point..
 
swaraj gupta
Ranch Hand
Posts: 186
Oracle C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks. i got it..

bhanu chowdary wrote:

swaraj gupta wrote:
m still confused...
initially if both the "sa" parameters have been Autoboxed to Integer then why not the method doStuff(Integer...i) has been invoked here..? Please help.


Swaraj, Array ia an Object and not an Integer.
<edit>
Wouter beat me by 2 minutes

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!