Back to notes -- Keyboard shortcut: 'u'              Slide program -- Keyboard shortcut: 't'    Local variables and instance variables - initialization and default values.Lecture 5 - slide 19 : 29
Program 1
using System;

class InitDemo{

  private int intInstanceVar;         
  private bool boolInstanceVar;       

  public void Operation(){
    int intLocalVar;                  
    bool boolLocalVar;                
    
    Console.WriteLine("intInstanceVar: {0}. boolInstanceVar: {1}", 
                      intInstanceVar,
                      boolInstanceVar);

    // Compile time errors:
    Console.WriteLine("intLocalVar: {0}. boolLocalVar: {1}",   
                      intLocalVar,    
                      boolLocalVar);  

  }

  public static void Main(){
    new InitDemo().Operation();
  }

}
 
 
 
 
default initial value: 0
default initial value: false
 
 
not initialized            
not initialized
 
 
 
 
 
 
 
Compile time errors: 
Use of unassigned local variables