In the below example:
class Foo {
public static String[] listofimages = new String[]{};
public static void main(String[] args) {
for(int i = 1; i <= 3; i++) {
listofimages[i] = //some image that I am adding to it
}
}
}
I am trying to access the newly modified listofimages variable in another class, Foobar (see below):
class Foobar(){
public void someClass{
Foo.listofimages //trying to access the newly modified listofimages variable with values in it
}
The above code is not working for me. I am confused on how to go about accessing the newly modified static variable listofimages, in a class that it is not declared in, class Foobar. Any help would be very much appreciated, thank you! :)