try this, 包你满意

Wolf wolf = new Wolf();
Animal wolf0 = (Animal)Activator.CreateInstance(wolf.GetType().BaseType);
wolf0.Eat();

所有跟帖: 

这个结果是对的,但是不是用的wolf -牛牛哥- 给 牛牛哥 发送悄悄话 牛牛哥 的博客首页 (66 bytes) () 09/15/2009 postreply 18:50:14

It is still from the wolf. If you don't want wolf0, try this. (( -me123456- 给 me123456 发送悄悄话 (124 bytes) () 09/16/2009 postreply 06:30:15

你好像不懂的什么是Derived,什么是Base,也不懂得题意 -st.paul- 给 st.paul 发送悄悄话 (118 bytes) () 09/16/2009 postreply 08:53:12

请您先登陆,再发跟帖!