• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to create varargs method in java...?  RSS feed

 
Abhijit Kangale
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

Can anybody explain me how can I declare & define variable argument method...? Please give small example program if possible.

Thanks & Regards,
ABHIJIT
 
Miklos Szeles
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the documentation.;)
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abhijit,
Welcome to the Ranch.

uses varargs and is similar to
 
Campbell Ritchie
Marshal
Posts: 56522
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch

That link is a bit hard for beginners to understand. There isn't much in the Java Tutorials about varargs, I am afraid. Please search this forum for "varargs" because somebody else asked a similar question very recently.
 
G.Sathish kumar
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vararg should be as last parameter so vararg should not be start of middle of arugment list

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