Skip to main content

C# Tutorial, Step-7, General Structure of a C# program

Hello, welcome to All. My name is Abdul Yesdani. Today we are learning about C# program structure. We will discuss about how the program skeleton is made of, what are the different components are in the program.

C# programs can have one or more files. Each file can contain no or plenty of namespaces. A namespace can contain types such as classes, structs, interfaces, enumerations, and delegates, in addition to other namespaces. According to the program needs we can add any of above mentioned types to the project.


The following is the skeleton of a C# program that contains all of these elements. No need to have all of these elements in the program, here all possible elements mentioned. 


// A skeleton of a C# program
using System;
namespace YourNamespace
{
    class YourMainClass
    {
            static void Main(string[] args)
            {
                //Your program starts here...
            }
       }
   class YourClass
    {
    }


    struct YourStruct
    {
    }


      interface IYourInterface
        {
        }


    delegate int YourDelegate();


    enum YourEnum
    {
    }


    namespace YourNestedNamespace
    {
        struct YourStruct
            {
            }
    }
}

using System means , we are using System namespace which contains all the types required to complete a console application.



                                                                        *******


Comments

Popular posts from this blog

Docker Image AWS

SQL server

  Microsoft SQL Server: Microsoft SQL Server is a relational database management system (RDBMS). Applications and tools connect to a SQL Server instance or database, and communicate using Transact-SQL (T-SQL). You can install SQL Server on Windows or Linux, deploy it in a Linux container, or deploy it on an Azure Virtual Machine. SQL Server components and technologies: Database Engine The Database Engine is the core service for storing, processing, and securing data. The Database Engine provides controlled access and transaction processing to meet the requirements of the most demanding data consuming applications within your enterprise.  Integration Services SQL Server Integration Services (SSIS) is a platform for building high performance data integration solutions, including packages that provide extract, transform, and load (ETL) processing for data warehousing. Analysis Services SQL Server Analysis Services (SSAS) is an analytical data platform and toolset for personal, te...