遍历Properties中的键值对

来源:互联网 发布:斯维尔计价软件 编辑:程序博客网 时间:2024/06/10 08:44

 public static void main(String[] args) throws FileNotFoundException, IOException {
  File file = new File("f:");
  Properties tian = new Properties();
  tian.load(new FileInputStream(new File(file,"tian.properties")));
  Iterator it=tian.entrySet().iterator();
  while(it.hasNext()){
      Map.Entry entry=(Map.Entry)it.next();
      System.out.println(entry.getKey().toString()+" = "+entry.getValue());
     
  }
 } 

0 0
原创粉丝点击