'break' only allowed in loops and switch statements
The compiler detected the keyword break occurring outside the scope of a loop or switch statement.
The following example illustrates this error:
public class Simple{
public void method1(){
if (true)
break;
//error: break allowed in loops only
}
}