想飞的鱼丶 2016-05-10 14:40 采纳率: 0%
浏览 807

写下一句时gd不能自动生成出现,

public class GoodList : CollectionBase
{
public virtual int Add(T fruit)
{
return InnerList.Add(fruit);
}
public new void RemoveAt(int index)
{
InnerList.RemoveAt(index);
}
public T GetItem(int index)
{
return (T)List[index];
}
public void Set(int index, T fruit)
{
this.RemoveAt(index);
this.Add(fruit);
}
}
public class Program
{
static void Main(string[] args)
{

    Fruti f1 = new Fruti("n1001","苹果","1.5",6);
    Fruti f2 = new Fruti("n1002", "香蕉", "0.4", 4);
    Fruti f3 = new Fruti("n1003", "橘子", "0.5", 10);
    Drink d1 = new Drink("n2001","绿茶","3",2);
    Drink d2 = new Drink("n2002", "红茶", "2.5", 4);
    GoodList gd=new GoodList();
  • 写回答

1条回答

  • 普通网友 2016-10-07 17:26
    关注

    时gd不能自动生成出现,
    public class GoodList : CollectionBase
    {
    public virtual int Add(T fruit)
    {
    return InnerList.Add(fruit);
    }
    public new void RemoveAt(int index)
    {
    InnerList.RemoveAt(index);
    }
    public T GetItem(int index)
    {
    return (T)List[index];
    }
    public void Set(int index, T fruit)
    {
    this.RemoveAt(index);

    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料