117
C#.net
5.2 C# Program Structure
In C#, a large program can consist of many pieces of small programs (or modules),
which can be written by different programmers. Hence, the same name may be
used in different small programs but actually correspond to different identifiers.
Namespace in C# is used to avoid confusion. A namespace is an abstract container
created to hold a logical grouping of names. A C# program contains one or more
namespaces. In Listing5.1, the C# program defines one default namespace called
“ConsoleApplication1” as shown in line 5.
To access the identifiers from other namespaces, the C# program must declare these
namespaces through the “using” statements as shown in lines 1 through 4 of Listing5.1.
e identifiers following the ...