📄 testgjh.java~4~
字号:
package com.test;
import java.util.ResourceBundle;
import java.util.Locale;
import java.text.MessageFormat;
public class TestGJH {
private static ResourceBundle bundle;
private static Locale currentLocale;
public static void main(String[] args) {
TestGJH testgjh = new TestGJH();
currentLocale = Locale.getDefault();
bundle = ResourceBundle.getBundle("com.test.testnew", currentLocale);
System.out.println(bundle.getString("name"));
System.out.println(bundle.getString("password"));
String msg = "{0}的老师是{1}";
MessageFormat mf = new MessageFormat(msg,currentLocale);
Object[] msgArgs = {name,new Date(),++num};
return mf.format(msgArgs);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -