求解一道java程序设计题目(编写一个课程类Cource)
答案:1 悬赏:70 手机版
解决时间 2021-03-29 05:49
- 提问者网友:斑駁影
- 2021-03-28 06:32
求解一道java程序设计题目(编写一个课程类Cource)
最佳答案
- 五星知识达人网友:风格不统一
- 2021-03-28 07:15
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());
}
}
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());
}
}
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯