?? test.java
字號:
public class Test{ //Person,Student類的定義同示例7-6
public static void main(String args[]){
Student m = new Student();
m.school = "pku"; //合法
Person e = new Student();
e.school = "pku"; //非法
}
}
class Person {
protected String name;
protected int age;
public String getInfo() {
return "Name: "+ name + "\n" +"age: "+ age;
}
}
class Student extends Person {
protected String school;
public String getInfo() {
return "name: "+ name + "\nage: "+ age
+ "\nschool: "+ school;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -