testgjh.java~6~
来自「梅花雪树的经典制作」· JAVA~6~ 代码 · 共 29 行
JAVA~6~
29 行
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 = {"文文","王友桂"};
System.out.println(mf.format(msgArgs));
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?