public void show(SE se) { Console.WriteLine("---程序员:{0}---", se.Name); Console.WriteLine("基本工资:{0}", se.BasicMoney); Console.WriteLine("考核工资:{0}", se.CheckMoney); Console.WriteLine("合计:" + (se.BasicMoney + se.CheckMoney)); }
static void Main(string[] args) { SE se = new SE(); se.Name = "张三"; se.BasicMoney = 30000; se.CheckMoney = 5000; SayHi s = new SayHi(); s.show(se); PM pm = new PM(); pm.Name = "李四"; pm.BasicMoney = 80000; pm.ItemsMoney = 8000; pm.Dividend = 2000; s.show(pm); Console.ReadLine(); }