C# Namespaces - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
C# Namespaces

C# Namespaces

Namespaces are heavily used in C# programming in two ways. First, the .NET Framework uses namespaces to organize its many classes, as follows:
In C#, global namespace is the root namespace. The global::System will always refer to the namespace "System" of .Net Framework.
System.Console.WriteLine("Hello World!");
System is a namespace and Console is a class in that namespace. The using keyword can be used so that the complete name is not required, as in the following example:

using System;

Console.WriteLine("Hello");
Console.WriteLine("World!");

C# namespace example

C# namespace example

Namespaces Overview

Namespaces have the following properties:
  • They organize large code projects.
  • They are delimited by using the . operator.
  • The using directive obviates the requirement to specify the name of the namespace for every class.
  • The global namespace is the "root" namespace: global::System will always refer to the .NET Framework namespace System.

About Mariano

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.