static void KhaiBaoStruct() { Console.Write("\nKhai bao struct co thuoc tinh, phuong thuc va truong private trong C#:\n"); Console.Write("----------------------------------------------------------------------\n"); newStruct myInstance = new newStruct(); myInstance.n = 15; myInstance.clsMethod(); }
static void Exercise60() { // Write a program in C# Sharp to declares a struct with a property, // a method, and a private field. Console.Write("\n\nDeclares a struct with a property, a method, and a private field :\n"); Console.Write("----------------------------------------------------------------------\n"); newStruct myInstance = new newStruct(); myInstance.n = 55; myInstance.clsMethod(); }