黑马程序员技术交流社区

标题: 这道题怎么理解呢? [打印本页]

作者: A昌_e244R    时间: 2016-5-31 01:11
标题: 这道题怎么理解呢?
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;
    }
}


作者: 善良的死神达乐    时间: 2016-5-31 01:31
为嘛都没有写注释的习惯???????
作者: gsa798780633    时间: 2016-5-31 11:01
看hello是否存在,不存在返回-1,否则返回0
作者: 土菠萝    时间: 2016-5-31 12:05
gsa798780633 发表于 2016-5-31 11:01
看hello是否存在,不存在返回-1,否则返回0

楼上正解




欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2