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
Can you set the unlimited length for "maxjsonlength" property in config?
What are actions in mvc?
How would you deploy your old applications with .net framework 4.0? Are the old applications compatible?
Are there any parts of the .net framework 3.0 that only work on windows vista?
What is the difference between old ADO.NET and Entity framework coding techniques?
What is the role of the jit compiler in .net framework?
What is the use of view model in asp.net mvc?
Explain what platforms does the .net framework run on?
What is partialview in asp.net mvc?
What is ViewStart Page in ASP.Net MVC?
Is .net framework backwards compatible?
Explain .Net Framework? Why we use it?
What is razor code?
explain what is ado.net entity framework?
What is the domain object?