• 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

Varargs and overloaded method doubt

 
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Can any one tell me how to call overloaded method checkThis() in following code.

Thanks in advance
 
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I think the compiler will complain about ambiguous methods because methods at line 1 and line 2 are too ambiguoud for compiler to determine which one to call. Though one may argue that double should be preferred over Double..but that wont happen I guess..
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think this program does't complile becouse of parameter of 2nd & 3rd checkThis method.The comlpiler does't detirmine which one will be called.

Main point to remember.... (from K & B book)
Widening beats boxing
Widening beats var-args
 
Rishiraj Bayerd
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think this program does't complile becouse of parameter of 2nd & 3rd checkThis method.The comlpiler does't detirmine which one will be called.

Main point to remember.... (from K & B book)
Widening beats boxing
Widening beats var-args

with regards
Rishi
 
reply
    Bookmark Topic Watch Topic
  • New Topic