读键值对封装成Map

  描述: 有配置文件address_relation.properties,记录地址关系,有如下数据:ZSSS=ZS%,ZSPD,

  封装到Map代码如下:

1   public static void main(String[] args) {
2         propertityUtil properies = propertityUtil
3                 .getInstance("address_relation.properties");
4         Properties prop = properies.getProp();
5         for (Object key : prop.keySet()) {
6             System.out.println(prop.getProperty((String) key));  // 得到value值
7         }
8     }

工具类请查看博文:读取配置文件工具类地址

原文地址:https://www.cnblogs.com/x-jingxin/p/7201202.html