C#编程中,出现 不包含采用“2”参数的构造函数的错误 怎么改?
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了C#编程中,出现 不包含采用“2”参数的构造函数的错误 怎么改?相关的知识,希望对你有一定的参考价值。
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 needTime)
progID++;
this.priorNUM = priorNUM;
this.cpuTime = 0;
this.needTime = needTime;
this.progStatus = "W";
------------------------
static void Main(string[] args)
PCBClass p1=new PCBClass (9,3);
public PCBClass(int priorNUM, int needTime)
progID++;
this.priorNum = priorNUM;
this.cpuTime = 0;
this.needTime = needTime;
this.progStatus = "W";
本回答被提问者和网友采纳 参考技术B 楼上的回答是正确的,你再建造构造函数的时候语法错了少了个public
以上是关于C#编程中,出现 不包含采用“2”参数的构造函数的错误 怎么改?的主要内容,如果未能解决你的问题,请参考以下文章