Click here to Skip to main content
16,016,391 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
public partial abstract class()
{
}
how is this class different from any other classes, partial what is it's main function in this class
Posted

In a simple word, "Partial classes span multiple files." For example, If you've worked with Windows Forms Application, you might have noticed one designer.cs file, that is nothing but The machine-generated C# code is separated.
It has no effect on class.

As per MSDN [^]:
Quote:
The partial keyword indicates that other parts of the class, struct, or interface can be defined in the namespace. All the parts must use the partial keyword. All the parts must be available at compile time to form the final type. All the parts must have the same accessibility, such as public, private, and so on.

-KR
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 7-Mar-14 11:33am    
Correct, a 5.
—SA
The partial keyword doesn't affect the class in any real way, it just allows it to be defined in more than one source file. This is handy if the class is getting large, and you want to organise it better, or if you want to split it into logical groups, such as a WinForms form - which is two partial class files for the same class: myClass.cs and myClass.Designer.cs to separate the code you write from the code Visual Studio writes.
In order to be used, all partial class files must declare the class as partial.

It has no other effect on the class whatsoever.
 
Share this answer
 
Comments
Paddy84 7-Mar-14 8:47am    
Nice explanation. +5
Faisalabadians 7-Mar-14 9:26am    
+5 for to the point explanation
Sergey Alexandrovich Kryukov 7-Mar-14 11:33am    
Correct, a 5.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900