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

Answers were Sorted based on User's Feedback



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

Answer / ssv_sathish

YES, basically, partial classes are meant for sharing or
working on different files. so you can have 2 partial
classes in the same file or different class declared as
partial in the same file, provided PUBLIC is the access
modifier.

Is This Answer Correct ?    35 Yes 4 No

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

Answer / 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

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

Answer / m.karunakar

yes.more than one programmer working in the same module in
the project.example one progrmmer writing one method in main
system and ononther programmer can also add onother method
are functionlity that class by using partial class.

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More Dot Net Framework Interview Questions

what is the three pillar of .Net ?

11 Answers  


How is method overriding different from method overloading

1 Answers   Siebel Systems,


mention in what all scenarios entity framework can be applicable?

0 Answers   Microsoft,


How do you enforce garbage collection in .NET

1 Answers   Wipro,


What type of filter does outputcacheattribute class represents?

0 Answers  






If you change something in web.config file.Do u need to compile again?

5 Answers   Broadridge, SMNetserv,


what is entity data model?

0 Answers   Microsoft,


What is viewbag title?

0 Answers  


How to identify the Code which Complies corresponding Compiler in .NET? Means Suppose, i am taking One project A.. in which code is implemented using C# langugge. And Another Project B..in Which Code is implemented using VB.NET. Suppose I am creating Project C. i am adding Reference of Project A and B to Project C. So, in Project C, how to identify Project A is Complied through CSCompliler? And Project B is Compiled VBCompiler at Runtime?

1 Answers  


What are ajax helpers in mvc?

0 Answers  


Which is the best institute in chennai to learn DotNet?

7 Answers  


What filters are executed in the end?

0 Answers  


Categories