日期:2014-05-18  浏览次数:21300 次

关于继承的问题
class A
{
public void A(int x,int y)
{
//....
}
}
class B:A
{
public void B(int x,int y):base(x,y)
{
//....
}
}
书上说,C#提供了base关键字来访问基类中的成员,这里的x,y并不是基类A中的成员,怎么说是继承那?
请各位赐教

------解决方案--------------------
class A 
{ 
public void A(int x,int y) 
{ 
console.writeline("it's A");
} 
} 
class B:A 
{ 
public void B(int x,int y):base(x,y) 
{ 
console.writeline("it's B");
} 
}

B b=new B(0,0);

你看看效果
  
*****************************************************************************
欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) 

http://feiyun0112.cnblogs.com/