C# Basic

C# is an object oriented language. In other words it contains classes, objects, interfaces and inheritance.

The First C# program

Type the following into a text editor (such as notepad), and save it with a .cs extension. (For eg  First.cs);

using System;

namespace MyFirstNamespace
{
           
            class MyFirstCsharpClass
            {
                       
                       
                        static void Main()
                        {
                        Console.WriteLine ("This is my first C #### C sharp code!");
                        Console.ReadLine();
                         return;
                        }
            }
}


 
 

You can compile this program by simply running C# command line compiler (CSC.Exe)

CSC First.cs
Then execute the First.exe by typing First at the command prompt

0 comments:

Post a Comment