I want to use an array in a method that got created in another method of the same class.
public class Class1 {
public static String[] method1() {
String[] array = new String[5];
array[0] = "test";
return array;
}
public void method2() {
System.out.println(array[0]);
}
}