C# FAQ: What is a namespace
What is a namespace? |
| A namespace is a method of organizing a group of assemblies, classes, or types. A namespace acts as a container—like a disk folder—for classes organized into groups usually based on functionality. C# namespace syntax allows namespaces to be nested.
For instance, to access the built-in input-output (I/O) classes and members, use the All C# programs should call the A namespace is similar to a Java The C++ namespace syntax is similar to the C# syntax. Using namespacesNamespaces are referenced by C# applications by using the using System; Unlike the Java language, an individual class cannot be referenced with the Referencing Console.WriteLine ("A console message."); AliasesAlthough the Commonly used namespacesThe following is list of some important and frequently used .NET namespaces:
A C# namespace is the equivalent of a Java language package. |
More Visual C# and Java Language FAQs
Go to Visual CSharp FAQ (main page).
Consider these related Frequently Asked Questions—FAQs:
- Are C# classes allocated on the heap?
- Are C# strings immutable?
- Does C# have a
throwsclause? - Does C# support boxing?
- Does C# support
finalclasses? - Does C# support jagged arrays?
- Does C# support static initialization blocks?
- How do Java and C# objects compare?
- What are the differences between C# and Java access modifiers?
- What are the differences between C# and Java constant declarations?
- What are the differences between C# and Java constructors?
- What are the differences between C# and Java exceptions?
- What are the differences between C# and Java garbage collection?
- What are the differences between C# and Java generics?
- What are the differences between C# and Java inheritance syntax?
- What are the differences between C# and Java keywords?
- What are the differences between C# and Java
Mainmethods? - What are the differences between C# and Java member initialization?
- What are the differences between C# and Java primitive types?
- What are the differences between C# and Java reflection?
- What are the differences between C# and Java runtimes?
- What are the differences between C# and Java variable length parameter lists?
- What are the differences between C# and Java virtual machines?
- What are the differences between C# finalizers and Java destructors?
- What is the difference between C# and Java array declarations?
- What is the difference between C# and Java constructor chaining?
- What is the difference between C# and Java enumerations (
enum)? - What is the difference between C# and Java
foreachloops? - What is the difference between C# and Java threads?
- What is the difference between C#
lockand Javasynchronized? - What is the difference between C#
usingand Javapackage? - What is the difference between calling base class constructors in C# and Java?
- What is the difference between metadata annotations in C# and Java?
- What is the difference between nested classes in C# and Java?