What is Partial Class ? How we can implement in C#.net applications.
Please send me with one example
What is Partial Class ? How we can implement in C#.net applications.
Please send me with one example
Join the conversation! Your thoughts help the community grow.
Join to leave a comment
Members earn 10 SHARP for a comment, 10 SHARP for a reaction, and 250 SHARP for every blog they publish.
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegisterMembers onlyFeatured eBookClaude for AI-Native BuildersDownload nowWrite a blog post and earn +250 SHARP when it is approved.
Write a blog
Gajendra kumarPosted Jun 12, 2007, 8:56 PM EDT
Hi Sarangi, partial classes mean that your class definition can be split into multiple physical file. using System; partial class XY { int x; public int X { get { return x; } set { x = value; } } } partial class XY { int y; public int Y { get { return y; } set { y = value; } } } class MainClass { public static void Main() { XY xy = new XY(); Console.WriteLine(xy.X + "," + xy.Y); } } partial classes allow you to split the definition of a class into multiple files, you cannot mix languages. Following are live example: They allow programmers on your team to work on different parts of a class without needing to share the same physical file. While this is useful for projects that involve big class files, be wary: If you find your class file getting too large, it may well signal a design fault and refactoring may be required. The most compelling reason for using partial class is to separate your application business logic from the designer-generated code. For example, the code generated by Visual Studio 2005 for a Windows Form is kept separate from your business logic (we will discuss this in a later section). This will prevent developers from messing with the code that is used for the UI. At the same time, it will prevent you from losing your changes to the designer-generated code when you change the UI. I hope now you have no confusion regarding partial class.