Static Main function : Main : Language Basics C# Source Code


Custom Search

C# Source Code » Language Basics » Main »

 

Static Main function









    

/*
Learning C# 
by Jesse Liberty

Publisher: O'Reilly 
ISBN: 0596003765
*/
 using System;
 namespace StaticTester
 {
     // create the class
    public class StaticTester
    {
       // Run is an instance method
       public void Run()
       {
           Console.WriteLine("Hello world");
       }

       // Main is static
       static void Main()
       {
           // create an instance
           StaticTester t = new StaticTester();

           // invoke the instance method
           t.Run();
       }
    }
 }

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Language Basics
» Main