[android]代码库
public class PropertiesReader{ public Map<String, String> getProperties() { Properties props = new Properties(); Map<String, String> map = new HashMap<String, String>(); try { InputStream in = getClass().getResourceAsStream("type.properties"); props.load(in); Enumeration en = props.propertyNames(); while (en.hasMoreElements()) { String key = (String) en.nextElement(); String property = props.getProperty(key); map.put(key, property); System.out.println(key + " " + property); } } catch (Exception e) { e.printStackTrace(); } return map; }}
中级程序员
by: 王大锤 发表于:2018-06-17 15:37:16 顶(1) | 踩(2) 回复
山东
回复评论