C#中,为什么这样会出现 不包含采用“4”参数的构造函数的错误?
classPCBClass{privatestaticintprogID=0;publicstaticintProgID{get{returnPCBClass.progI...
class PCBClass
{
private static int progID = 0;
public static int ProgID
{
get { return PCBClass.progID; }
//set { PCBClass.progID = value; }
}
private int priorNum;
public int PriorNum
{
get { return priorNum; }
set { priorNum = value; }
}
private int cpuTime;
public int CpuTime
{
get { return cpuTime; }
set { cpuTime = value; }
}
private int needTime;
public int NeedTime
{
get { return needTime; }
set { needTime = value; }
}
private string progStatus;
public string ProgStatus
{
get { return progStatus; }
set { progStatus = value; }
}
PCBClass(int priorNum, int cpuTime, int needTime, string progStatus)
{
// progID++;
this.priorNum = priorNum;
this.cpuTime = cpuTime;
this.needTime = needTime;
this.progStatus = progStatus;
}
}
----------------------------
static void Main(string[] args)
{
PCBClass p1=new PCBClass (9,0,3,"W");
} 展开
{
private static int progID = 0;
public static int ProgID
{
get { return PCBClass.progID; }
//set { PCBClass.progID = value; }
}
private int priorNum;
public int PriorNum
{
get { return priorNum; }
set { priorNum = value; }
}
private int cpuTime;
public int CpuTime
{
get { return cpuTime; }
set { cpuTime = value; }
}
private int needTime;
public int NeedTime
{
get { return needTime; }
set { needTime = value; }
}
private string progStatus;
public string ProgStatus
{
get { return progStatus; }
set { progStatus = value; }
}
PCBClass(int priorNum, int cpuTime, int needTime, string progStatus)
{
// progID++;
this.priorNum = priorNum;
this.cpuTime = cpuTime;
this.needTime = needTime;
this.progStatus = progStatus;
}
}
----------------------------
static void Main(string[] args)
{
PCBClass p1=new PCBClass (9,0,3,"W");
} 展开
若以下回答无法解决问题,邀请你更新回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询