- A C# programs can contain one or more files.
- Each program file can contain zero to N number of namespaces.
- A namespace can contain types such as classes, interfaces, enumerations, structs and delegates.
- Skeleton of a C# program that contains all of the above elements.
C#
using System;
namespace NameOfYour_Namespace
{
class NameOfYour_Class
{
}
struct NameOfYour_Struct
{
}
interface NameOf_IYourInterface
{
}
delegate int NameOfYour_Delegate();
enum NameOfYour_Enum
{
}
namespace NameOfYour_NestedNamespace
{
struct NameOfYour_Struct
{
}
}
class NameOfYour_MainClass
{
static void Main(string[] args)
{
//Do something
}
}
}