📄 whereami.java
字号:
import java.util.*;
class WhereAmI {
/* The program for finding Where Am I? by J M Bishop Dec 1997
* -----------------------------------
* updated July 2000
* Illustrates the use of classes in Java packages
* and the facility of changing locales.
*/
public static void main (String [ ] args) {
new WhereAmI ();
}
WhereAmI () {
Locale here = Locale.getDefault();
System.out.println("My Locale is " + here);
System.out.println("Country: " + here.getCountry());
System.out.println("Language: " + here.getLanguage());
System.out.println("Country: " + here.getDisplayCountry());
System.out.println("Language: " + here.getDisplayLanguage());
System.out.println();
Locale there = new Locale("GERMAN","GERMANY");
there.setDefault(Locale.GERMANY);
System.out.println("New Locale is " + there);
System.out.println("Country: " + there.getCountry());
System.out.println("Language: " + there.getLanguage());
System.out.println("Country: " + there.getDisplayCountry());
System.out.println("Language: " + there.getDisplayLanguage());
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -