摘要:
class Test { public static void Main() { Console.Write(StudentInfo.Name);//输出ligang Console.Read(); } } //静态方法一般使用静态成员实例方法可以使用静态方法,而静态方法不能使用实例方法 static class StudentInfo { private static string name = "ganquanfu"; public static string Name { get { return StudentInfo.name; } set { StudentIn 阅读全文
摘要:
public static void Main(string[]args) { Person student = new Person(); student.Name = "甘全福"; student.Age = 23; Person teacher = student.Clone(); Console.WriteLine("姓名:"+teacher.Name + "年龄:" + teacher.Age); Console.WriteLine("克隆成功!"); Console.Read(); } class Pe 阅读全文
摘要:
class Test { public static void Main() { Console.Write(StudentInfo.Name);//输出ligang Console.Read(); } } //静态方法一般使用静态成员实例方法可以使用静态方法,而静态方法不能使用实例方法 static class StudentInfo { private static string name = "ganquanfu"; public static string Name { get { return StudentInfo.name; } set { StudentIn 阅读全文