User Program Communication

Namespace in C#

Namespaces are used to group methods, classes, and other code into a package for use in many different files.

The .NET framework comes with many (including the popular System.IO), and in order to certain classes within the framework (like File), use of the namespace must be declared.

namespace namespaceName {
    ///methods, classes, etc

///accessing a namespace member without 'using' it

///to access members of a namespace without the prefix
using namespaceName;


Many of the non-default namespaces require the importing of the dll file into the IDE.

using System.IO;

///the Console class is actually a part of the System.IO namespace
Console.WriteLine("Hello, World!");

See Also

namespace (C# Reference) - MSDN

Add to Slack

< Write to File   |   Primitive Data Types >

© 2019 SyntaxDB. All Rights Reserved.