this code just doesnt want to wrok. it stops on the last loop. It doesnt even run the loop. here is the codedoes anyone has any ideas why? I only got few hours till i have to have this finished...Code:public static int testMethod(int lineCount3, int lineCounter, String userSelection, String[][] initialCourses, String[][] userData)
{
Scanner input = new Scanner(System.in);
boolean check = false;
int finalCheck = 0;
for(int z = 1; z < lineCounter; z++)
{
if(userSelection.equals(initialCourses[z][1]))
{
System.out.println("SUCCESS");
System.out.println("WHY AM I STOPPING");
check = true;
}
else if(z == (lineCounter - 1))
{
System.out.println("You have entered invalid course code");
System.out.println("Please enter course code again\n");
userSelection = input.nextLine();
z=0;
}
}
if(check == true)
{
System.out.println("OMG OMG OMG");
for(int g = 1; g < lineCount3; g++)
{
System.out.println("final Test2");
if(userSelection.equals(userData[g][1]))
{
System.out.println("You are already enrolled in this course");
finalCheck = 1;
break;
}
else if(g == (lineCount3 - 1))
{
System.out.println("Course Added");
finalCheck = 1;
break;
}
}
}
return finalCheck;
}

