System Namespace

Assembly: mscorlib.dll

Description: Contains fundamental classes and base types that define commonly used value and reference data types, events and event handlers, exceptions, and arithmetic operations. This is the most fundamental namespace in the .NET Framework.

URL: docs.microsoft.com/en-us/dotnet/api/system

Key Types

Object

Provides functionality for all classes in the .NET Framework class hierarchy, serving as the ultimate base class of all types.

View details →

String

Represents text as a sequence of characters. It is an immutable type, meaning that once a String object is created, its value cannot be changed.

View details → }

Int32

Represents a 32-bit signed integer.

View details →

Boolean

Represents a Boolean value (true or false).

View details →

Exception

The base class for all exceptions in the .NET Framework class library.

View details →

Array

The base class for all arrays in the .NET Framework.

View details →

DateTime

Represents an instant in time, typically expressed as a date and time of day.

View details →

Console

Provides standard input, output, and error streams for console applications.

View details →

Math

Provides a set of methods for performing mathematical operations.

View details →

Convert

Provides methods to convert a basic type to another basic type.

View details →

Commonly Used Classes

The System namespace includes many essential classes for general-purpose programming. Some of the most frequently used include:

Example Usage

Here's a simple example demonstrating the use of the String and Console classes from the System namespace:


using System;

public class HelloWorld
{
    public static void Main(string[] args)
    {
        string message = "Hello, World!";
        Console.WriteLine(message);

        int number = 42;
        Console.WriteLine("The answer is: " + number.ToString());
    }
}