Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
MethodName(String args[])
{...}
Method2(){
String stringVariable= "something i want to pass";
MethodName(stringVariable);
}
Method2(){
String stringVariable= "something i want to pass";
String stringArray[];
stringArray[0]=stringVariable;
MethodName(stringArray);
}
public class StringArrayTest {
public static void main(String[] args) {
String stringVariable = "Something to pass to the method.";
String[] stringArray = new String[1];
stringArray[0] = stringVariable;
MethodTakingArray(stringArray);
}
static void MethodTakingArray(String args[]) {
for (int i = 0; i < args.length; ++i)
System.out.println(args[i]);
}
}
MethodName(new String[] { "something" });
String[] sArr = new String[1];
sArr[0] = "something";
MethodName(sArr);