Play audio slide show -- Keyboard shortcut: 'x'  Back to slide -- Keyboard shortcut: 'u'  next  next  Play sound for this slide -- Keyboard shortcut: 'y'  FinallyBreak.java - Illustration af finally i forhold til break.Lecture 10 - slide 20 : 26
Program 2

class FinallyBreak {

  public static void main(String[] args){

    int i = 0;

    while (i < 10){
      try{
        i = i + 1;
        System.out.println("Gentagelse for i = " + i);
        if (i == 5) break;
      }
      finally{
        System.out.println("Slutning med i = " + i);
      } // end try
    }
    System.out.println("Løkken slut");
  }
}