摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace InterFaceTest{ //声明接口 public interface ISleep { void sleep(); } //实现接口 public class People : ISleep { public void sleep() { Console.WriteLine("人睡觉"); ... 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace abstractTest{ //只要一个方法声明为:abstract,类也必须使用abstract修饰,abstract修饰的类不能实例化 public abstract class Person { //声明SayHello抽象方法 public abstract void SayHello(); } public class Chinese : ... 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 继续{ public class Person { public string Name { get; set; } public int Age { get; set; } public virtual void SayHello() { Console.WriteLine("我的名字是:{0},年龄是{1}",Name,... 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 继续{ public class Person { public string Name { get; set; } public int Age { get; set; } public string language { get; set; } public virtual void SayHello() { ... 阅读全文