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
What is the difference between viewbag and viewdata in mvc?
Explain the use of Inversion of control (IOC)?
Explain entity lifecycle? : Entity framework
Does windows 10 need .net framework?
What are the advantages of razor view engine?
How does servicing work for the .net framework 3.0? If I install the .net framework 3.0, can I get service updates for the .net framework 2.0?
What is controllercontext?
Which is the default http method for an action method?
What is entitycontainer? : Entity framework
What are sections?
Explain what platforms does the .net framework run on?
What is latest version of .net framework?
What is the version number for the next version of the .net framework, codenamed �orcas�?
How to change the action name in ASP.Net MVC?
What is the use of the default route {resource}.axd/{*pathinfo} ?