/**
* @(#)Demo.java
*
*
* @author
* @version 1.00 2007/5/22
*/
import java.io.*;
public class Demo
{
public Demo()
{
}
public static void main(String[] args)
{
try{
int acount;
byte[] bInput=new byte[100];
String str=new String();
FileInputStream file=new FileInputStream(new File("1.doc");
acount=file.read(bInput);
str=str+new String(bInput);
System.out.print(str);
}catch(IOException e)
{
System.out.println(e.getMessage());
}catch(FileNotFoundException er)
{
System.out.println(er.getMessage());
}
}
}
我觉得这段代码没有问题啊!
--------------------Configuration: <Default>--------------------
E:\学习\Java\Demo.java:31: 已捕捉到异常 java.io.FileNotFoundException
}catch(FileNotFoundException er)
^
1 错误
Process completed.
[此贴子已经被作者于2007-5-22 9:08:15编辑过]