正在加载图片...
1 'TestApplication.Child1.f()'hides inherited member 'TestApplication.Parent.f()'.To make the current member override that implementation,add the override keyword.Otherwise add the new keyword. class Parent { public int x=8; C C:\WINDOWS\system32\cmd.exe public virtual void f() Parent.x=8 Child.x=9 Console.WriteLine("Parent f"); Parent f 2 Child f 请按任意键继续. class Child1 Parent new public int x=9; public void f() Console.WriteLine("Child f"); class Test static void Main(string[]args) { Console.WriteLine("Parent.x={0}",new Parent().x); Console.WriteLine("Child.x=0}",new Child1().x); new Parent().f(); new Child1().f(); 11 11 隐藏方法
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有