What is Partial Class ..?

Why it used..?

Your Answer

Why to use Partail Class:
1.
When working on large projects, spreading a class over separate files enables multiple programmers to work on it at the same time.

2.When working with automatically generated source, code can be added to the class without having to recreate the source file. Visual Studio uses this approach when it creates Windows Forms, Web service wrapper code, and so on. You can create code that uses these classes without having to modify the file created by Visual Studio.
3.
To split a class definition, use the partial keyword modifier, Please see the example given bellow.

Example:
public partial class Employee
{
public void DoWork()
{
//Some Code
}
}
public partial class Employee {
public void GoToLunch()
{
//Some Code
}
}

after this we can create the object of class. and call the methods.
Employee e=new Employee ();
e.DoWork();
e.GoToLunch();
It should helpfull for your question.

C Sharp Dot Net

Didn't get the answer.
Contact people of Talent-C Sharp Dot Net directly by clicking here