日期:2014-05-17 浏览次数:20719 次
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication2 { class Program { static void Main(string[] args) { B b = new B(); b.sum("abc", "def"); b.sum(5, 6); b.sum(1.2, 3.4); Console.ReadKey(); } abstract class A { public abstract int sum(int i,int j); } class B : A { public override int sum(int i, int j) { Console.WriteLine(i + j); return 0; } public double sum(double i, double j) { Console.WriteLine(i + j); return 0; } public string sum(string i, string j) { Console.WriteLine(i + j); return "abc"; } } } }