I could not find out the reason why this code skips scan.nextLine()... I put comment on that line... when I go the debugger and skip over it doesnt allow me to enter the String data..
import java.util.Scanner;
public class Main {
public static void main(String[] args){
int x =0, y=0;
char path[][];
Scanner scan = new Scanner(System.in);
x = scan.nextInt();
y = scan.nextInt();
path = new char[x][y];
String[] input = new String[y];
for(int i = 0; i < x; i++){
input[i] = scan.nextLine(); // this line is skipped...
for(int yIndex = 0; yIndex < input.length; yIndex++){
path[i][yIndex] = input[i].charAt(yIndex);
}
}
}