A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

© A昌_e244R 中级黑马   /  2016-5-31 01:11  /  743 人查看  /  3 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

import java.io.*;
public class Mine {
    public static void main(String argv[]){
         Mine m=new Mine();
         System.out.println(m.amethod());
    }
    public int amethod() {
         try {
             FileInputStream dis=
new FileInputStream("Hello.txt");
         }catch (FileNotFoundException fne) {
             System.out.println("No such file found");
             return -1;
         }catch(IOException ioe) {
         } finally{
             System.out.println("Doing finally");
         }
         return 0;
    }
}

3 个回复

倒序浏览
为嘛都没有写注释的习惯???????
回复 使用道具 举报
看hello是否存在,不存在返回-1,否则返回0
回复 使用道具 举报 1 0
gsa798780633 发表于 2016-5-31 11:01
看hello是否存在,不存在返回-1,否则返回0

楼上正解
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马