A partial class can span multiple source files. : Partial Class : Class C# Examples


C# Examples » Class » Partial Class »

 

A partial class can span multiple source files.









    
using  System;


public  partial  class  MyClass  {

        public  void  CoreMethodA()  {
                Console.WriteLine("MyClass.CoreA");
        }
}

public  class  Starter  {
        public  static  void  Main()  {
                MyClass  obj  =  new  MyClass();
                obj.CoreMethodA();
                obj.ExtendedMethodA();
        }
}


public  partial  class  MyClass  {

        public  void  ExtendedMethodA()  {
                Console.WriteLine("MyClass.ExtendedA");
        }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Class
» Partial Class