I tried to break out of a for
loop but it doesn't break.
How do I get or break out of this do...while
loop from inside of the for
loop?
Here CompanyEmployee
is an ArrayList
of objects of the Employee
class and the CasualEmployee
class inherits from the Employee
class.
do {
System.out.print("ENTER ID:\t");
String s=s3.nextLine();
for(int i=3;i<9;i++) {
System.out.println(CompanyEmployee.get(i).getID());
if(s==CompanyEmployee.get(i).getID()) {
String data=CompanyEmployee.get(i).toString();
WeekSchedule[check1][check]=data;
break;
}
}
}
while(true);