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

Java基础1 加载资源

2012-12-23 
Java基础一 加载资源一 加载资源,一般两种方式,class使用绝对路径,thread使用相对包路径???URL t Thread

Java基础一 加载资源

一 加载资源,一般两种方式,class使用绝对路径,thread使用相对包路径

???URL t = Thread.currentThread().getContextClassLoader().getResource("META-INF/log4j.properties");

? InputStream in2 = Thread.currentThread().getContextClassLoader().getResourceAsStream("META-INF/log4j.properties");


???URL t1 = Bootstrap.class.getResource("/META-INF/log4j.properties");

? ?InputStream in =? Bootstrap.class?.getResourceAsStream("/META-INF/log4j.properties");
??

?

?

?

?

?

热点排行