In this session
•Basic
structure of C# program.
•What
is Namespace.
•
Purpose
of Main method
Basic structure of C# program.
Below is given a sample program.
In this program we have a 3 line of code
In this program we have a 3 line of code
using System;
class Program
{
static void Main()
{
Console.WriteLine("Hello to the world");
Main1();
}
static void Main1()
{
Console.WriteLine("Hello to Main !");
}
}
At the top , we have declared a namespace System in which Console class is residing.
within Console class WritLine() method is present. Which take an argument as a string and print the message to the out output console screen.
Using
system declaration
•A
namespace declaration , Using System, indicate that you are using the system
Namespace.
•A
namespace is used to organize your code and is a collection of classes , interfaces, structs, enums and delegates.
•Main Method is the entry point of into
your application.
Video comes on the top followed by the explanatory text.
ReplyDelete