?? wiring.java
字號:
/*
* s2javaoo.lg.ch02.Wiring.java
* 2007-7-23
* 電器類
*/
package s2javaoo.lg.ch02;
public class Wiring {
private int power; // 功率
private int pressure; // 額定電壓
private int current; // 額定電流
private String electricity; // 交直流類型
/**
* 構造方法
*/
public Wiring() {
this.setPressure(220);
this.setElectricity("交流");
}
/**
* 電器工作的方法
*/
public void work() {
System.out.println("電器在工作");
System.out.println("這個電器的功率是 " + power);
System.out.println("這個電器的額定電壓是 " + pressure);
System.out.println("這個電器的額定電流是 " + current);
System.out.println("這個電器的交直流類型是 " + electricity);
}
/**
* @return current
*/
public int getCurrent() {
return current;
}
/**
* @param current 要設置的 current
*/
public void setCurrent(int current) {
this.current = current;
}
/**
* @return power
*/
public int getPower() {
return power;
}
/**
* @param power 要設置的 power
*/
public void setPower(int power) {
this.power = power;
}
/**
* @return pressure
*/
public int getPressure() {
return pressure;
}
/**
* @param pressure 要設置的 pressure
*/
public void setPressure(int pressure) {
this.pressure = pressure;
}
/**
* @return type
*/
public String getElectricity() {
return electricity;
}
/**
* @param type 要設置的 type
*/
public void setElectricity(String electricity) {
this.electricity = electricity;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -