usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespacepatial{classProgram {Static voidMain (string[] args) {Student s=NewStudent (); S.METHOD2 (); Console.readkey (); } } Public Partial classStudent {Private int_age; Public voidMethod1 () {Console.WriteLine ("method1"); } } Public Partial classStudent { Public voidMethod2 () {///calling private properties in a partial class_age = -; Console.WriteLine ("method2"); Console.WriteLine (_age); } }}
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespacepatial{classProgram {Static voidMain (string[] args) {Student s=NewStudent (); S.METHOD2 (); Console.readkey (); } } Public Partial classStudent {Private int_age; Public voidMethod1 () {Console.WriteLine ("method1"); } } Public Partial classStudent { Public voidMethod2 () {///calling private properties in a partial class_age = -; Console.WriteLine ("method2"); Console.WriteLine (_age); } }}
C # Partial classes use partial adornments