|
-
How to pass variable number of argumants to "method"(not main())
hi
i am devloping a program in which i have to pass variable number of arguments
to the method defined in other class how would i do that
for example,
public class myClass{
public static void main(){
OtherClass oClass = new OtherClass();
/**
i want exectly the same implemantation
as shown below
*/
oClass.otherMethod("arg1","arg2","arg3"); //all the arguments
oClass.otherMethod("arg4"); //are String
}//!myClass
//this class is defined in other file and dosnt have
// main() method
public class OtherClass{
//what should i put as the arguments the otherMethod takes
public otherMethod(?????????){....implemantation...}
} //!OtherClass
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks