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 tempdata?
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#?
Can I uninstall microsoft .net framework?
What is the difference between partial and renderpartial?
Can I use razor code in javascript in asp.net mvc?
Explain what languages does the .net framework support?
Explain the types of Scaffoldings.
what is model first approach?
How to Redirect Tracing to a File
what is split entity?
what is code first approach?
Explain ASP.NET MVC Identity and Security?
What are HTML Helpers, AJAX Helpers in ASP.Net MVC?
What is associationset? : Entity framework
What is the role of the jit compiler in .net framework?