📝 What is namespace in C#?
A namespace is designed for providing a way to keep one set of names separate from another. The class names declared in one namespace does not conflict with the same class names declared in another.
🔸 NET uses namespaces to organize its many classes.
🔸 Declaring your own namespaces can help you control the scope of class and method names in larger programming projects.
A namespace is designed for providing a way to keep one set of names separate from another. The class names declared in one namespace does not conflict with the same class names declared in another.
🔸 NET uses namespaces to organize its many classes.
🔸 Declaring your own namespaces can help you control the scope of class and method names in larger programming projects.
SampleNamespace#post
{
class SampleClass
{
public void SampleMethod()
{
System.Console.WriteLine(
"SampleMethod inside SampleNamespace");
}
}
}