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

Can you set the unlimited length for "maxjsonlength" property in config?

559


What are actions in mvc?

551


How would you deploy your old applications with .net framework 4.0? Are the old applications compatible?

482


Are there any parts of the .net framework 3.0 that only work on windows vista?

557


What is the difference between old ADO.NET and Entity framework coding techniques?

556






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

623


What is the use of view model in asp.net mvc?

683


Explain what platforms does the .net framework run on?

546


What is partialview in asp.net mvc?

593


What is ViewStart Page in ASP.Net MVC?

573


Is .net framework backwards compatible?

605


Explain .Net Framework? Why we use it?

609


What is razor code?

596


explain what is ado.net entity framework?

568


What is the domain object?

541