ResourceBundle 用法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wpwbb510582246/article/details/83547155
//    读取 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"));

猜你喜欢

转载自blog.csdn.net/wpwbb510582246/article/details/83547155