日期:2014-05-18 浏览次数:20656 次
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Collections; namespace TestAbstract { class Program { static void Main(string[] args) { string s = "ZhangSan"; ZhangSan A = new ZhangSan1(); A.eat(s); Console.ReadLine(); } } abstract public class Person { abstract public void eat(string s); } public class ZhangSan : Person { public override void eat(string s) { Console.WriteLine(s); } } public class ZhangSan1 : ZhangSan { public override void eat(string s) { Console.WriteLine("ZhangSan1"); } } }