Play audio slide show -- Keyboard shortcut: 'x'  Back to lecture notes -- Keyboard shortcut: 'u'              Play sound for this slide -- Keyboard shortcut: 'y'  Lecture 3 - slide 16 : 39
 

class BlockDemo1 {

static int var1;

static void proc(int p){ 
  var1 = p;
}

public static void main(String[] args){  
  
  int var2;

  var1 = 5;

  {   
    var1 = 6;
    int var3 = 7;  //erklæring i blok
    var2 = 8;
    var3 = 9;
  }

  
  if (var1 == 5)
    var1 = 6;

  if (var1 == 6){    
    var1 = 7;
    proc(8);
    var2 =10;
  }
 }//main

}