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 partialview in asp.net mvc?

607


Why we need a separate mobile project template, while we can render our web application in mobile ?

602


What is .net framwork?

573


Is .net framework 4.8 the last version?

542


How to use Jquery Plugins in ASP.Net MVC validation?

552






What is asp net framework?

523


What are differences between entity framework and l2s? : Entity framework

661


What are the levels at which filters can be applied in an asp.net mvc application?

600


What is the use of viewmodel in mvc?

628


What is the difference between model view and controller?

491


Where is tempdata stored?

560


Mention the core components of .net framework?

586


What is mapping in entity framework? : Entity framework

528


What are the components required to create a route in mvc?

624


What are action filters?

614