ResourceBundle读取配置文件

import java.util.ResourceBundle;

/**
* Created by win7 on 2017/5/20.
*/
public class Test1 {
public static void main(String[] args) {

ResourceBundle resb3 = ResourceBundle.getBundle("abc");
System.out.println("name;"+resb3.getString("name"));
System.out.println("sex:"+resb3.getString("sex"));
System.out.println("测试中文:"+resb3.getString("ceshi"));
System.out.println("ip:"+resb3.getString("ip"));
}



}

src下 abc.properties文件
name=hahh
sex=bai

ceshi=测试

ip=192.168.10.12
上一篇:.NET快速开发实践中的IExtenderProvider扩展组件


下一篇:POS机数据泄露已蔓延至云端