Lecture overview -- Keyboard shortcut: 'u'  Previous page: Organization of C# Programs [Section] -- Keyboard shortcut: 'p'  Next page: Examples of Program Organization -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home  Page 18 : 29
Object-oriented Programming in C#
Reference types, Value types, and Patterns
Program Organization

The structure and organization of a C# program is radically different from the structure and organization of both C programs and Java programs.

C# programs declare types which contain members. Types are organized in namespaces.

  • C# programs are organized in namespaces

    • Namespace can contain types and - recursively - other namespaces

  • Namespaces (and classes) in relation to files:

    • One of more namespaces in a single file

    • A single namespace in several files

    • A single class in several files - partial classes

  • The mutual order of declarations is not significant in C#.

    • No declaration before use.

  • When compiled, C# programs are organized in assemblies

    • .exe and .dll files