what are partial classes?

Answer Posted / sridhar.venkataramanan

File 1.
partial class Employee
{
string employeename;
public void getEmployeeName(string empname)
{
employeename = empname;
}

public static void Main()
{

Employee objEmployee = new Employee();
objEmployee.getEmployeeName("Krish");
objEmployee.showEmployeeName();
Console.ReadLine();
}

}
File 2

partial class Employee
{
public void showEmployeeName()
{
Console.WriteLine("Name --->" + employeename);
}

}

Even though the method showEmployeeName is not a available
in file 1 since its partial class the complier would
combine the fragments of the file that corresponds to same
class.

Is This Answer Correct ?    28 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is tempdata?

618


what is dot net? what is use dot net? what is benifit of dot net?what is vb dot net? what is ado dot net? what is c#?

1811


Can I uninstall microsoft .net framework?

554


What is the difference between partial and renderpartial?

499


Can I use razor code in javascript in asp.net mvc?

545






Explain what languages does the .net framework support?

526


Explain the types of Scaffoldings.

633


what is model first approach?

609


How to Redirect Tracing to a File

597


what is split entity?

605


what is code first approach?

590


Explain ASP.NET MVC Identity and Security?

576


What are HTML Helpers, AJAX Helpers in ASP.Net MVC?

586


What is associationset? : Entity framework

570


What is the role of the jit compiler in .net framework?

629