what are partial classes and their use?

Answer Posted / dasharatham

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 ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between mvc and asp.net? : Asp.Net MVC

859


What is a session in programming?

796


What is slidemaster?

729


what are configuration files?

784


Explain Apache web servers ? How can you get ASP.NET running in Apache web servers - why should you do this?

763


What is s2s tracking?

769


What is the basic purpose of the required field validator? How can you use a required field validator to check that the user changes the initial value of a text box? a listbox?

1671


What are assemblies and namespaces and explain the difference between them ?

862


Explain the difference between debug.write and trace.write? When should each be used?

794


What New Features comes with ASP.NET Web API 2.0?

798


What are the differences between code behind and code inline?

763


Disable Mouse right click on web page in asp.net?

796


What is the difference between a candidate key and primary key?

799


By default, Web API sends HTTP response with which of the following status code for all uncaught exception?

1328


What is the Intermittent crashing of application in production?

812