Init variable : Variable Definition : Language Basics C# Source Code


Custom Search

C# Source Code » Language Basics » Variable Definition »

 

Init variable









    

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

Publisher: Sybex;
ISBN: 0782129110
*/

/*
  Example2_5.cs is the same as Example2_4.csc, except
  myValue is assigned a value before it is referenced
*/

public class Example2_5
{

  public static void Main()
  {

    int myValue = 2;
    System.Console.WriteLine(myValue);  // no error

  }

}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Language Basics
» Variable Definition