package ttt2;
import java.util.Scanner;
public class TTT2 {
public class State{
int[][] sheet;
int childCount;
public void initialize(int n,int[][] lastState,int level){
sheet=new int[n][n];
childCount=n*n-1;
State[] nextState=new State[childCount];
nextState[0].initialize(n,sheet,level+1);
int turn=level%2+1;
}
}
public static void main(String[] args) {
System.out.print("Enter the size(n) of the sheet(n*n):");
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int[][] matrix=new int[n][n];
State s=new State();
}
}
I am having this issue no matter what I try. I tried everything i could. While declaring an object of the State class it is showing an error "non-static variable this cannot be referenced from a static context"