Something simple and simple.
switch(menu_ini)
{
case 1: // Ingresar datos!.
int i;
for (i = 1; i == item.length; i++)
{
System.out.println("ITEM?:");
item[i] = sc.next();
System.out.println("Categoria?:");
categoria[i] = sc.next();
}
System.out.println("DUNNO");
break;
The switch works great, but when entering the case 1, you should show me the message "ITEM?" to then let me enter the String ... then the message "CATEGORY?" and then let me enter another String ... And so go fill the array. However, that does not happen ... the FOR loop is completely skipped and it prints the string "DUNNO" that I put below to test that it actually enters the case 1.
I already tried with sc.nextLine () and the same thing happens ... What am I doing wrong?. Thanks in advance.