Partial Class in Net 2.0

One of the language enhancements in .NET 2.0-available in both VB.NET 2005 and C# 2.0-is support for partial classes. Partial classes mean that your class definition can be split into multiple physical files. Logically, partial classes do not make any difference to the compiler. During compile time, it simply groups all the various partial classes and treats them as a single entity.

One of the greatest benefits of partial classes is that it allows a clean separation of business logic and the user interface (in particular the code that is generated by the visual designer). Using partial classes, the UI code can be hidden from the developer, who usually has no need to access it anyway. Partial classes will also make debugging easier, as the code is partitioned into separate files. And also using partia class we can new functionality to the existing type.

e.g.

partial class csharp
{
string Str="Partial Class";
}

partial class csharp
{

public void show()
{
Console.WriteLine(Str);
}

}

Class Program
{
static void Main()
{
csharp obj=new csharp();
obj.show();
}
}