Code class A { protectedstring stra; public A() { stra ="A"; } } class B : A { protectedstring strb; public B() : base() { strb ="B"; } publicvoid show() { Console.WriteLine(stra); Console.WriteLine(strb); } } class Program { staticvoid Main(string[] args) { A b =new B(); b.show();//Error:“A”并不包含“show”的定义 Console.Read(); } }
posted on
2008-06-28 09:11张少峰
阅读(191)
评论(0)
编辑收藏举报