What is namespace?

1 Answer

Answer :

Namespaces allow us to group a set of global classes, objects and/or functions under a  name. To say it somehow, they serve to split the global scope in sub-scopes known as  namespaces.
The form to use namespaces is:
namespace identifier { namespace-body }
Where identifier is any valid identifier and namespace-body is the set of classes, objects  and functions that are included within the namespace. For example:
namespace general { int a, b; } In this case, a and b are normal variables integrated within  the general namespace. In order to access to these variables from outside the namespace  we have to use the scope operator ::. For example, to access the previous variables we  would have to put:
general::a general::b
The functionality of namespaces is specially useful in case that there is a possibility that a  global object or function can have the same name than another one, causing a redefinition  error.

Related questions

Description : A ____ is a namespace for organizing classes and interfaces in a logical manner. Placing your code into ______makes large software projects easier to manage. This section explains why this is useful and ... provided by the Java Platform: a) Inheritance b) Object c) Package d) None of These

Last Answer : c) Package

Description : Python - AttributeError: 'Namespace' object has no attribute 'rfileTr' -Web-Development

Last Answer : answer:

Description : What is the difference between a namespace and an assembly name?

Last Answer : A namespace is a logical naming scheme for types in which a simple type name, such as MyType, is preceded with a dot-separated hierarchical name. Such a naming scheme is completely under ... design-time naming convenience, whereas an assembly establishes the name scope for types at run time.

Description : What namespace would you use for reflection?

Last Answer : System.Reflection 

Description : What is a namespace? 

Last Answer : A namespace declares a scope which is useful for organizing code and to distinguish one type from another.

Description : Is it namespace class or class namespace?

Last Answer : The .NET class library is organized into namespaces. Each namespace contains a functionally related group of classes so natural namespace comes first. 

Description : A zone is a contiguous portion of a ………….. of the DNS namespace whose database records exist and are managed in a……….. DNS database file. A. domain, particular B. Class, particular C. tree, local D. Domain, every

Last Answer : A. domain, particular

Description : The ____ namespace is based on a hierarchical and logical tree structure A. DNS B. Address C. table D. both a and b

Last Answer : A. DNS

Description : What are the advantages of HDFS federation in Hadoop? a) Isolation b) Namespace scalability c) Improves throughput d) All of the above

Last Answer : All of the above

Description : Which namespace enables multithreaded programming in XML?

Last Answer : System.Threading

Description : Define namespace?

Last Answer : The namespace is known as containers which will be used to organize the hierarchical set of.Net classes.

Description : Mention the assembly name where System namespace lies in C#?

Last Answer : Assembly Name – mscorlib.dll

Description : Which namespace is used for SSLStream class?  A) System.Collections B) System.Net.Security C) System.Security D) System.Diagnostics

Last Answer : Which namespace is used for SSLStream class?  System.Net.Security