+ 2

How pass array of string to methods

29th Sep 2017, 6:09 PM
Sandeep Kumar R
Sandeep Kumar R - avatar
3 ответов
+ 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
29th Sep 2017, 6:17 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 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); } }
29th Sep 2017, 6:17 PM
Dev
Dev - avatar