Using static can be a problem sometimes. Pass a reference (use "this") to the constructor when you create the class that needs the reference and have the constructor save it in a class variable. ...
Type: Posts; User: Norm
Using static can be a problem sometimes. Pass a reference (use "this") to the constructor when you create the class that needs the reference and have the constructor save it in a class variable. ...
Are you asking how to get the values for component2 when executing a method in component1?
You need a reference to component2 in component1 so that the methods in component1 can use that reference...
I was referring to the massive list of assignment statements for the map array:
int[][] map = new int[32][12];
map[0][0] = 1;
map[1][0] = 0; //<<<<<<<<<<<<< NOT NEEDED
...
The default value for an element in an int array is 0. You only need to set the non-zero entries.