当前位置:java工程师信产部认证考试题库

问题:

[单选]

在J2EE中,如果去编译并运行下面的代码,在这里假定在当前目录下没有Hello.txt文件:
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;   } } 
结果会输出()。 

A . No such file found
B . No such file found -1
C . No such file found doing finally -1
D . 0

公共图书馆是由国家或地方政府管理、资助和支持的,免费为社会公众服务的图书馆。 抑制球团矿还原膨胀的措施有()。 A.进行含铁原料合理搭配 。 B.适当添加Cao 。 C.添加烟煤 。 D.提高焙烧温度。 根据区域协调问题的性质的差别,区域协调可以分为()。 外部协调。 政府协调。 民间协调。 内部协调。 用于扩瞳、查眼底的药物是() 毒扁豆碱。 溴丙胺太林。 东莨菪碱。 阿托品。 后马托品。 施工项目安全管理第一责任人是()。 项目法人。 项目经理。 施工员。 质检员。

在J2EE中,如果去编译并运行下面的代码,在这里假定在当前目录下没有Hello.txt文件:
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;   } } 
结果会输出()。 

参考答案: C

  参考解析

本题暂无解析

在线 客服