Illustrates variable scope : Variable Definition : Language Basics C# Source Code


Custom Search

C# Source Code » Language Basics » Variable Definition »

 

Illustrates variable scope








    

/*
Mastering Visual C# .NET
by Jason Price, Mike Gunderloy

Publisher: Sybex;
ISBN: 0782129110
*/

/*
  Example2_6.cs illustrates scope
*/

public class Example2_6
{

  public static void Main()
  {

    {
      int myValue = 1;
    }

    myValue = 2;  // causes error

  }

}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Language Basics
» Variable Definition