?? animal.java.txt
字號:
package ch7.section7_3;
public abstract class Animal {
String color;
String name;
int state = 1; //默認設為活動狀態
//構造方法
Animal(String name, String color) {
this.name = name;
this.color = color;
}
//設定動物狀態
void setState(int state) {
this.state = state;
}
int getState() { return state; } //得到動物目前狀態
void run() { System.out.println("跑..."); } //奔跑
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -