求解一道java程序设计题目(编写一个课程类Cource)

2020-05-15 教育 131阅读
public class Cource{
private String cNumber;
private String cName;
private double cUnit;
public static int cTotalNum = 0;
public Cource(){
this.cName="java";
this.cNumber="123";
this.cUnit = 100;
this.cTotalNum++;
}
public String getCName() {
return cName;
}
public void setCName(String name) {
cName = name;
}
public String getCNumber() {
return cNumber;
}
public void setCNumber(String number) {
cNumber = number;
}
public double getCUnit() {
return cUnit;
}
public void setCUnit(double unit) {
cUnit = unit;
}

public void printCourceInfo(){
System.out.println("cName:"+this.getCName());
System.out.println("cNumber:"+this.getCNumber());
System.out.println("cUnit:"+this.getCUnit());
}
}
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com