what are partial classes and their use?



what are partial classes and their use?..

Answer / alb.shah

This is a feature of 2005,when we have large and unwildly
classes instead of writing all the methods in same program
we will divide the class into number of programs with the
same class name,these classes are preceeded with partial
keyword,when we compile all this partial classes only one
dll with the same class name will be created.


class with some 20 methods:
Example.cs
class classA{
m1( );
m2( );
.
.
.
m20( );
}

Apply partial concept:

Example1.cs
partial class classA
{
m1( );
m2( );
.
.
m8( );
}
example2.cs
partial class classA
{
m9( );
m10( );
.
.
m15( );
}
Example3.cs
partial class classA
{
m16( );
.
.
m20( );
}

if we compile Examle1.cs,Example2.cs,Example3.cs it will
create only one dll

Is This Answer Correct ?    9 Yes 0 No

Post New Answer

More ASP.NET Interview Questions

Features in ASP.NET ?

1 Answers   Microsoft,


One Listbox showing all cities. If you select one city in list box the information related to that particular city should be displayed in Datagrid . How do you do that?

3 Answers   HCL,


What are the advantages of passport authentication?

0 Answers  


Explain the difference between webfarm and webgardens in .net?

0 Answers  


If(dropdownlist1.selectedIndexChanged==true) { //code } else { //code } I am getting error in If condition, so can u pls give me a solution.

4 Answers  






whats the purpose of AUTOPOSTBACK property for the controls in asp.net?

4 Answers  


What’s difference between “optimistic” and “pessimistic” locking?

0 Answers  


when we write the html code with runat = server it works like a server control than why we use the server control?

1 Answers  


Difference between mvc2 and mvc3 in asp.net?

4 Answers   Wipro,


What is the difference between stored procedure vs function?

0 Answers  


Explain the differences between Server-side and Client-side code?

2 Answers  


what are the State management and Its Uses

2 Answers  


Categories