How to reference a 2D array from a static context?
问题 Every time I call myGrid in the generateBoard method, I get the error: non-static variable myGrid cannot be referenced from static context To my understanding, this shouldn't happen, because I've set the array to be public and should be able to be accessed from any other class. So have I set up the array incorrectly? import java.util.Random; public class Zombies { private int Level = 1; private int MoveNo = 0; public int[][] myGrid = new int[12][12]; public static void generateBoard() {