my dog learned polymorphism
The moose likes Beginning Java and the fly likes method declaration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "method declaration" Watch "method declaration" New topic
Author

method declaration

Swathi Rangudu
Greenhorn

Joined: Sep 07, 2008
Posts: 4
How to declare a method with n-number of arguments in java?Please give me any idea..

Thanks in advance...
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42954
    
  73
Do you mean varargs?
Swathi Rangudu
Greenhorn

Joined: Sep 07, 2008
Posts: 4
I mean can we declare a method like printf() in C (example) which it takes n-number of arguments at runtime
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19911
    
  23

Originally posted by Ulf Dittmer:
Do you mean varargs?

Quoted for relevance and importance. Just read it


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 41098
    
  29
Originally posted by Rob Prime:
. . . Just read it


Read this Java Tutorial page too.
Swathi Rangudu
Greenhorn

Joined: Sep 07, 2008
Posts: 4
yes....
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: method declaration