Exception in thread "main" java.io.FileNotFoundException: C:\acm.txt (系统找不到指定的文件。)
publicclassjbx1{publicstaticvoidmain(Stringargs[])throwsIOException{FileInputStreamfi...
public class jbx1{
public static void main(String args[]) throws IOException {
FileInputStream fis=new FileInputStream("C:\\acm.txt");
BufferedInputStream bis ;
DataInputStream dis=new DataInputStream(fis);
String file = "C:\\acm.txt";
BufferedReader br=new BufferedReader(new FileReader(file));
try {
String str1=null;
BufferedWriter br1 = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("C:\\T\\test.txt")));
while ((str1=br.readLine())!=null) {
if(str1.charAt(str1.length() -1)=='0')
br1.write(str1);
}
} catch (IOException e) {
e.printStackTrace();
}
dis.close();
}
}
Exception in thread "main" java.io.FileNotFoundException: C:\acm.txt (系统找不到指定的文件。)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at java.io.FileReader.<init>(FileReader.java:41)
at jbx1.main(jbx1.java:33)
报错如下:
Exception in thread "main" java.io.FileNotFoundException: C:\acm.txt (系统找不到指定的文件。)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at jbx1.main(jbx1.java:29) 展开
public static void main(String args[]) throws IOException {
FileInputStream fis=new FileInputStream("C:\\acm.txt");
BufferedInputStream bis ;
DataInputStream dis=new DataInputStream(fis);
String file = "C:\\acm.txt";
BufferedReader br=new BufferedReader(new FileReader(file));
try {
String str1=null;
BufferedWriter br1 = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("C:\\T\\test.txt")));
while ((str1=br.readLine())!=null) {
if(str1.charAt(str1.length() -1)=='0')
br1.write(str1);
}
} catch (IOException e) {
e.printStackTrace();
}
dis.close();
}
}
Exception in thread "main" java.io.FileNotFoundException: C:\acm.txt (系统找不到指定的文件。)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at java.io.FileReader.<init>(FileReader.java:41)
at jbx1.main(jbx1.java:33)
报错如下:
Exception in thread "main" java.io.FileNotFoundException: C:\acm.txt (系统找不到指定的文件。)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at jbx1.main(jbx1.java:29) 展开
3个回答
展开全部
File file=new File("C:\\acm.txt");
FileInputStream fis=new FileInputStream(file);
FileInputStream fis=new FileInputStream(file);
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
C:\acm.txt找不到
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你inputstream没有源文件 怎么可能有输入?
你要先去C盘下创建个acm.txt
你要先去C盘下创建个acm.txt
追问
c盘里有这个文件
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询