+ 2
How pass array of string to methods
3 Answers
+ 9
public class program
{
public static void main (String args [])
{
String[] arrayofstring = {"hello","thanks","luka"};
double x = method (arrayofstring);
}
public static double method (string [] [] arrayofstring)
{ //statement(s); }
}
//hope it helps âș
//u can see this code ... i have used double array ... u can do the same with string array
https://code.sololearn.com/cqQY720P8Um0/?ref=app
+ 8
// For Example :
public class test {
public static void someFunction(String[] strArray) {
// do something
}
public static void main(String[] args) {
String[] strArray = new String[]{"Foo","Bar","Car"};
someFunction(strArray);
}
}