namespace (MSDN)
http://msdn.microsoft.com/ko-kr/library/0d941h9d(v=vs.100).aspx
namespace (C# Study)
http://csharpstudy.com/CSharp/CSharp-namespace.aspx
namespace (Hoons.net)
http://www.hoons.kr/Lecture/LectureMain.aspx?BoardIdx=43000&kind=53&view=0
namespace (Winapi)
http://www.winapi.co.kr/dotnet/book/2-3-1.htm
using System;
namespace ConsoleApplication1
{
namespace A
{
class MyClass
{
int value = 1;
public void MyMethod() { System.Console.WriteLine(value); }
}
}
namespace B
{
class MyClass
{
double value = 2.1;
public void MyMethod() { System.Console.WriteLine(value); }
}
}
class Program
{
static void Main(string[] args)
{
A.MyClass a = new A.MyClass();
a.MyMethod(); // 1 출력
B.MyClass b = new B.MyClass();
b.MyMethod(); // 2.1 출력
}
}
}
{
class SampleClass
{
public void SampleMethod()
{
System.Console.WriteLine(
“SampleMethod inside SampleNamespace”);
}
}
// Create a nested namespace, and define another class.
namespace NestedNamespace
{
class SampleClass
{
public void SampleMethod()
{
System.Console.WriteLine(
“SampleMethod inside NestedNamespace”);
}
}
}
class Program
{
static void Main(string[] args)
{
// Displays “SampleMethod inside SampleNamespace.”
SampleClass outer = new SampleClass();
outer.SampleMethod();
// Displays “SampleMethod inside SampleNamespace.”
SampleNamespace.SampleClass outer2 = new SampleNamespace.SampleClass();
outer2.SampleMethod();
// Displays “SampleMethod inside NestedNamespace.”
NestedNamespace.SampleClass inner = new NestedNamespace.SampleClass();
inner.SampleMethod();
}
}
}