我尝试使用
FileInputStream
创建一个对象,并将文件的相对路径传递给它的构造函数,但它不能正常工作并抛出了一个FileNotFoundException
异常。try {
InputStream is = new FileInputStream("/files/somefile.txt");
} catch (FileNotFoundException ex) {
System.out.println("File not found !");
}