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

Every day Hands on Exercises / Assignments

Day wise hands on exercises/ assignments Day 1: HTML Hands on Exercises Date:04-10-2021 1.Create a web page to display your name, designation, location. 2. Create a web page to show about yourself in 3, 4 paragraphs. 3. Create a web page to display some nature images and Describe those images. 4.create a web page about college anniversary celebrations Divide your page in 4, 5 div elements . In the 1st div, put the heading of college , and display other details about the college. In the second div put images of the college. In third div put details of celebrations in paragraphs In the fourth div display the guest list. Use style attribute for doing color, background color, font etc, To emphasise some special content use elements like , 5. Create a web app on Indian cultural festivals. Use semantic elements for lay out of the page. Define an external style sheet and link with the page. Your app should have indexpage, cultural page, about us page. You should navigate amon...

.Net Presentation

.NET is a free, cross-platform, open source developer platform for building many different types of applications. With .NET, you can use multiple languages, editors, and libraries to build for web, mobile, desktop, games, and IoT. You can write .NET apps in C#, F#, or Visual Basic. C# is a simple, modern, object-oriented, and type-safe programming language. F# is a programming language that makes it easy to write succinct, robust, and performant code. Visual Basic is an approachable language with a simple syntax for building type-safe, object-oriented apps. You can write .NET apps in C#, F#, or Visual Basic. C# is a simple, modern, object-oriented, and type-safe programming language. F# is a programming language that makes it easy to write succinct, robust, and performant code. Visual Basic is an approachable language with a simple syntax for building type-safe, object-oriented apps.

Python for Beginners Intro -3

Python for beginners introduction -3 In this presenetation you will learn about OOPs programing how to inherit a base / parent class to a derived/ child class. Exception handling concepts, file handling concepts. You will also learn about python libraries like numpy, pandas and matplotlib.