java.lang.Class.getResource()のサンプル

Javaコード:
@Test
public void testFuncRec() throws IOException{

File file = new File(TestRelativePath.class.getResource(“/changfademo.txt").getFile());
BufferedReader br = new BufferedReader(new FileReader(file));
String len = null;
while ((len=br.readLine())!=null){
System.out.println(len);
}
}

Java

Posted by arkgame