首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 其他相关 >

只是想写上日志

2012-08-28 
只是想写下日志知道现在的基础薄弱,所以所要在近期多补补基础知识。然后把上班该做的事做好了。property取得

只是想写下日志
    知道现在的基础薄弱,所以所要在近期多补补基础知识。然后把上班该做的事做好了。

property取得字节流并且遍历的两种方法


1.

   private static Properties props=new Properties();
   static {
        InputStream ips = PropertiesUtil.class.getClassLoader().getResourseAsStream("opt.properties");
props.load(ips);
Iterator it = props.entrySet().iterator();
  while(it.hasNext()){
      Entry e = (Entry)it.next();
        system.out.println(""+e.getKey()+""+e.getValue();)
}
}

2.

Properties p=new properties();
p.load(new FileInputStream(new file("c:\\p.properties")));
.....

热点排行