正在加载图片...
结构和枚举 示列 使用类版Student和结构版Student实现下面操作 static void Main(string args) { 使用引用类型 Student student1 new Student(); Student student2=new Student(); student1.Age =18; student2 student1; CC:\TINDOYS\system321cmd.exe ✉▣x student2.Age=20; student1 20,student2 20 Console.WriteLine("s 请按任意键继续. student2.Age); w 13结构和枚举 13 使用类版Student和结构版Student实现下面操作 static void Main(string[] args) { //使用值类型 StructStudent student1 = new StructStudent(); StructStudent student2 = new StructStudent(); student1.Age = 18; student2 = student1; student2.Age = 20; Console.WriteLine("student1 = {0},student2 = {1}", student1.Age, student2.Age); } static void Main(string[] args) { //使用引用类型 Student student1 = new Student(); Student student2 = new Student(); student1.Age = 18; student2 = student1; student2.Age = 20; Console.WriteLine("student1 = {0},student2 = {1}", student1.Age, student2.Age); }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有