Input says its a 2d char array. But when I’m scanning it, it gives NoSuchElement Exception
Code to scan 2d char array:
Scanner sc = new Scanner(System.in);
int m = sc.nextInt();
int n = sc.nextInt();
char[][] board = new char[m][n];
for (int i = 0; i < m; i++)
for (int j = 0; j < n; j++)
board[i][j] = sc.next().charAt(0);
if this solves your doubt please mark it as resolved