?? location.java
字號:
package com.j2medev.chapter4;
//Location代表查詢的位置
public class Location {
private String[] location = new String[3];
public static final int CITY = 0;
public static final int REGION = 1;
public static final int COUNTRY = 2;
public Location() {
}
public String get(int field){
if(field < 0 || field > 2)
throw new IllegalArgumentException("The unit field is not defined");
return location[field];
}
public void set(int index,String value){
location[index] = value;
}
public String toString(){
return "city : "+location[0]+"\n"
+"region : "+location[1]+"\n"
+"country : "+location[2]+"\n";
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -