// 读取 classpath 路径下的 my.properties 文件 ResourceBundle bundle = ResourceBundle.getBundle("my"); // 先读取 classpath 路径下的 my_zh_CN.properties 文件,如果该文件不存在,则读取 my_zh.properties 文件,如果该文件不存在,则读取 my.properties 文件 ResourceBundle bundle = ResourceBundle.getBundle("my", new Locale("zh", "CN"));
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/177295.html原文链接:https://javaforall.net
