C#程序问题,哪里错,怎么改,不懂别来
来源:百度知道 编辑:UC知道 时间:2024/06/27 05:36:57
public abstract class A
{private int m_y;
public virtual int X
{ get{ return 0;} }
public virtual int Y
{ get{return m_y;}
set{m_y=value;} }
public abstract int Z{get;set;}
}
public class B:A
{private int m_z;
public override int X
{ get{return base.X+1;} }
public override int Y
{ set{base.m_y=value<0?0:value;} }
public override int Z
{ get{return m_z;} }
}
{private int m_y;
public virtual int X
{ get{ return 0;} }
public virtual int Y
{ get{return m_y;}
set{m_y=value;} }
public abstract int Z{get;set;}
}
public class B:A
{private int m_z;
public override int X
{ get{return base.X+1;} }
public override int Y
{ set{base.m_y=value<0?0:value;} }
public override int Z
{ get{return m_z;} }
}
由于是抽象继承与重载 所以在class A中定义的m_y访问限制修饰符要有protected或public 在class B中才能用base关键字
我所知道的就这些拉 不好意思
我不懂,所以我来了...
问人问题,还那么牛,真是林子大了,啥鸟都有
看你牛哄哄的样子,自己很懂嘛,还来问干嘛
你牛啥!问问题谦虚点啊!人家懂得都不愿意回答
这问题十分十分的牛!仅比楼主牛少半分 0分的