在J2EE中,如果去编译并运行下面的代码,在这里假定在当前目录下没有Hello.txt文件:import&e
在J2EE中,如果去编译并运行下面的代码,在这里假定在当前目录下没有Hello.txt文件:
importjava.io.*;
publicclassMine{
publicstaticvoidmain(Stringargv[]){
Minem=newMine();
System.out.println(m.amethod());}
publicintamethod(){try{
FileInputStreamdis=newFileInputStream("Hello.txt");}
catch(FileNotFoundExceptionfne){
System.out.println("Nosuchfilefound");
return-1;}
catch(IOExceptionioe){}finally{
System.out.println("Doingfinally");}
return0;}}
结果会输出()。