覆盖父类以上的这个方法public new string testa()

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ClassLibrary1
{
    public class Test
    {
        public string testa()
        {
            return "testa父类";
        }
    }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ClassLibrary1
{
    public class Test2cs : Test
    {
        /// <summary>
        /// 覆盖父类以上的这个方法
        /// </summary>
        /// <returns></returns>
        public new string testa()
        {
            return "testa子类";
        }
    }
}

posted @ 2014-08-22 15:38  feimon  阅读(86)  评论(0)    收藏  举报