InputStream is =
this.getClass().getClassLoader().getResourceAsStream(
"foo.properties");//foo.properties 是一个文件名,同此类放在同一目录下。Properties props = new Properties();
try {
props.load(is);
String value = (String)props("hello");
System.out.println("Value of hello is: " + value);} catch (IOException e) {
System.err.println("Load failed");
}我想写一个小例子程序,引用以上的code snippit,能运行就行。请帮忙。