abstract class Vehicle { public abstract void Drive(); } class Car : Vehicle { public override void Drive() { Console.WriteLine("Car is driving..."); } } class Bus : Vehicle { public override void Drive() { Console.WriteLine("Bus is driving…
转自 http://hi.baidu.com/wjinbd/item/c54d43d998beb33be3108fdd 1 创建自己要用的类 class stu { string _name; int _age; public string name {get{return _name;} set {_name=value;} } public int age { get { return _age; } set { _age = value; } } } 2 使用反射方法 public obj…
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Kernel.Interface { public interface IObjcet { void Put(); void Put(string plus); } } using System; using System.Collections.…