![]() |
What is namespaces In .NET ?
Namespace is a Keyword used declare a Scope. If you do not declare a namespace, a default namespace will be created. this unnamed namespace some times called Global namespace, this will created every file.
|
Using system;
Class A { show() { System.Console.WriteLine("Hello World!"); } } |
Namespace is a Keyword used declare a Scope
|
Quote:
Namespaces are a way of grouping type names and reducing the chance of name collisions. namespace ExampleNamespace { class TestExample { public void ShowMessage() { Console.WriteLine("This is the TestExample namespace!"); } } } |
Namespace is simply a large collection of classes. If you do not enter any name space it will be global automatically. So all classes are the sub class of namespace
|
Namespace basically declares the scope of that particular keyword for example that particular keyword's property is private, public or if there is no namespace it means the keyword is global and any class can use it.
To the best i know. |
NameSpace is a logical group of type or we can say that namespace is a container of class, interface, structure etc.It reduces the chance of name collisions.Namespace with all the functionality come under system namespace. It organize large block of code and they are delimited by using the . operator. using directives are used in namespace.
|
Hi,
A namespace is used to organize your code and is collection of classes, interface, structs, enum and delegate. Thanks |
All times are GMT -7. The time now is 04:50 PM. |
Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.