Here is my problem:
Scanner input = new Scanner(System.in);
int[] firstline = new int[3];
for(int i=0;i<3;i++){
System.out.print("The first line: ");
firstline[i] = input.nextInt();
}
String[] array0 = new String[3];
String[] array1 = new String[3];
for(int lim=0;lim<2;lim++){
for(int i=0;i<3;i++){
System.out.print("array"+lim+"["+i+"]: ");
if(lim == 0){
array0[i] = input.nextLine();
}else{
array1[i] = input.nextLine();
}
}
}
System.out.print(array0[0]);
When I compiled it, fine. But when I ran it:
array0[0] didn't allow me to type in. While others worked fine. I have run in Dr.java and Intellij and they gave me the same result
Does anyone have an explanation? Thanks first in advance.