using System;
namespace FirstProgram
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World");
}
}
}
The System namespace contains fundamental classes and base classes that define commonly used types, events, interfaces, and more.
Namespace => A namespace is a way to organise classes, structs, interfaces, enums, and delegates to avoid naming conflicts and improve code readability.
It acts like a container that helps distinguish between classes with the same name (e.g., if two libraries define an Animal class, namespaces prevent confusion).
Main => The Main method is the entry point of the program.
Console is a class that has a WriteLine() method.
Top comments (0)