fork(1) download
  1. class Ideone
  2. {
  3. public static void main (String[] args)
  4. {
  5. int k = 0;
  6. while(true) {
  7. System.out.println("Current k = " + k);
  8. if( k == 10) {
  9. System.out.println("Break outside loop");
  10. break;
  11.  
  12. }
  13. k++;
  14. }
  15. }
  16. }
Success #stdin #stdout 0.09s 320576KB
stdin
Standard input is empty
stdout
Current k = 0
Current k = 1
Current k = 2
Current k = 3
Current k = 4
Current k = 5
Current k = 6
Current k = 7
Current k = 8
Current k = 9
Current k = 10
Break outside loop