If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

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...}

Re: How to pass variable number of argumants to "method"(not main())

manish <mbd72@hotmail.com> wrote in message news:38db7cd1@news.devx.com...
>
> 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"); file://all the arguments
> oClass.otherMethod("arg4"); file://are String
> }//!myClass
>
> file://this class is defined in other file and dosnt have
> // main() method
>
> public class OtherClass{
>
> file://what should i put as the arguments the otherMethod takes
> public otherMethod(?????????){....implemantation...}
>
> } file://!OtherClass
>
>