using System;
namespace Exercise
{
public abstract class Gun
{
public Gun(string name, int bullets)
{
}
public string Name { get; set; }
public int Bullets
{
get { return Bullets; }
set
{
if (value < 0)
{
throw new Argument?xception("Bullets cannot be below 0");
}
else
{
Bullets = value;
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
这是我试图运行的代码。我已经检查过,框架是一样的,这是对类似问题的回答。我正在使用 VS 代码并下载了所有必要的扩展。你知道是什么导致了这个错误吗?
找不到类型或命名空间名称“Argument?xception”(您是否缺少 using 指令或程序集引用?)
c# ×1