Can we have more than 1 partial classes in the same file?

Answer Posted / mahesh kotekar

It is possible to have partial class in same class file.

Partial Class Concept was used in dotnet to provide
practically dividing the class into two or multiple physical
files. In order to keep the complexity of class
simple.During compilation the partial classes join together
to form a single class and works as normal class
partial class First
{
public static void DoSomething1()
{
Console.WriteLine("Executing from First Part of
Class First");
}
}
partial class First
{
public static void DoSomething2()
{
Console.WriteLine("executing from second part of
class First");
}
}

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

mention what are the various methods provided by the dataset object to generate xml?

842


What are the versions of .net framework?

788


What is routeconfig.cs in mvc 4?

912


what is entity framework advantage?

832


Will the name change be reflected in any of the existing .net framework 2.0 apis, assemblies, or namespaces?

802


Explain the methods used to render the views in mvc?

806


What is the version number for the next version of the .net framework, codenamed �orcas�?

739


How large is the .net framework 3.0?

795


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

918


What are action filters?

813


Is it possible to create a custom filter?

783


what is entityclient?

915


What is session state management?

804


What are Scaffold templates in ASP.Net MVC?

803


What is representational state transfer (rest) mean?

776