java读取properties文件

来源:互联网 发布:小型电动粉碎机淘宝网 编辑:程序博客网 时间:2024/05/18 03:33
String IP_ADDR = null;        int PORT;        Properties prop = new Properties();        //读取属性文件tcp.properties        InputStream in = getClass().getResourceAsStream("tcp.properties");        prop.load(in);     ///加载属性列表        IP_ADDR = prop.getProperty("IP_ADDR");        PORT = Integer.valueOf(prop.getProperty("PORT"));
原创粉丝点击