当前位置: 代码迷 >> J2SE >> 有关properties输入流的有关问题
  详细解决方案

有关properties输入流的有关问题

热度:69   发布时间:2016-04-24 13:50:25.0
有关properties输入流的问题
对于properties文件
staic{
        .........
      InputStream   =
                className.class.getClassLoader().
                getResourceAsStream( "path ");
      ..........
}
为什么要用这种方式获得流,不是很懂,有人能帮我分析下吗?谢了!


------解决方案--------------------
因为你的properties文件放在类路径上,所以可以使用这种方式从类路径上查找资源。
  相关解决方案