Code in Loop What Happens
break Execution jumps immediately to the 1st statement after the for loop.
return Execution jumps immediately back to the calling method.
System.exit() All program execution stops; the VM shuts down.
publicclass MainClass{
publicstaticvoid main(String[] argv){
System.out.println();
}
staticboolean doStuff() {
for (int x = 0; x < 3; x++) {
System.out.println("in for loop");
return true;
}
return true;
}
}