日期:2014-05-18 浏览次数:21029 次
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            B b = new B();
            Console.WriteLine(b.x);
            Console.Read();
        }
        
    }
         public class A {
            public int x ;
            
        }
        public class B:A{
            public int x;  //A包含x成员,B类也包含x成员,并特意使用new修饰符隐藏A类的x成员。
    
        }
}