break statement is ignored.
in this "program" there is two break statements, the first one is ignored, for what reson?
What am I trying to do is enter info for x number of students(firstname, lastname and civic creg number), and if that student already exists, you will reenter the info.
Also tried this method:
public static void main (String args) throws Exception
Scanner in = new Scanner (System.in);
System.out.println ("How many studens are there in your class?");
int students = in.nextInt ();
String info = new String[students];
System.out.println ("Please specify the student information by FIRSTNAME LASTNAME CIVI-CREG-NUMBER");
for (int i = 0; i < info.length; i++)
info[i] = in.nextLine ();
[B]if (i == 0)[/B] //The first time you enter student info is there nothing to compare with, so we break the loop.
for (int j = 0; j != i; j++)
boolean comparing = info[i].equals (info[j]);
if (comparing == false)
System.out.println ("That person already exists!!");