Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

regarding var-args

 
RatnaSekhar Kamireddy
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi this is ratna sekhar . i am preparing scjp.
i have finished first chapter in kathy sierra and bret bates.
In first chapter , there is a new topic regarding var-args.
they gave the syntax of how to declare the var-args and how to use(invoke);
but they didnt give regarding of definition of that method.
how the arguments in the var-arg method initialized.
please tell me in depth
ok bye
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Check code above it shows all details about var args.
 
wise owen
Ranch Hand
Posts: 2023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chapter 5: Creating Varargs in Java 1.5 Tiger
 
Burkhard Hassel
Ranch Hand
Posts: 1274
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
gowher amin naik recently wrote:

Hi, to make it clearer it should have been:

Yours,
Bu.
 
Vijay Vaddem
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

You would find varargs very handy when you need to write a method which could take 'n' number of parameters for a given argument.

It is equivalent to writing a method which takes an array argument.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic