• 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

SCJP Chapter 01 Self Test Qn no. 3

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

Answer:
-> A and E use valid var-args syntax.
My Doubt Is Why "Option B" Is Wrong ??
thanks in advance
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello rajan,
Option B is not correct. Because If you use it, then at line 3 and 4 will cause compilor error as it couldn't find match. Because doStuff(1) expect a function that takes an integer argument not an integer array argument (except var-args). Same reason for doStuff(1,2).
 
kiruthigha rajan
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Md. Minhajur Rahman wrote:Hello rajan,
Option B is not correct. Because If you use it, then at line 3 and 4 will cause compilor error as it couldn't find match. Because doStuff(1) expect a function that takes an integer argument not an integer array argument (except var-args). Same reason for doStuff(1,2).



now its clear..thanks alot sir..
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic