Simplest namespace with class definition : Namespace : Language Basics C# Examples


C# Examples » Language Basics » Namespace »

 

Simplest namespace with class definition





A namespace is declared using the namespace keyword.
The general form of namespace is shown here:




    
namespace  name  {
        //  members
        }
    
   
  
   





    
using  System;

namespace  HelloWorld
{
    ///  <summary>
    ///  Summary  description  for  Class1.
    ///  </summary>
    class  Class1
    {
        ///  <summary>
        ///  The  main  entry  point  for  the  application.
        ///  </summary>
        [STAThread]
        static  void  Main(string[]  args)
        {
            System.Console.WriteLine(  "Hello  world  from  C#"  );  
        }
    }
}
    
   
  
   



Output

Hello world from C#


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Language Basics
» Namespace