计算机二级JAVA模拟题17

考试站(www.examzz.com)   【考试站:中国教育考试第一门户】   2014年7月10日
11.下列关于面向对象的论述中,正确的是(      )。  
A.面由对象是指以对象为中心,分析、设计和实现应用程序的机制  
B.面向对象是指以功能为中心,分析、设计和实现应用程序的机制  
C.面向对象仅适用于程序设计阶段  
D.面向对象是一种程序设计语言  
12.语句"Hell0".equals("hell0");的正确执行结果 
public static void main(String[]args){ 
int[]x={0,1,2,3};  
for{int i=0;i<3;1+=2){ 
try{ 
systcm.OUt.println(x[i+2]/x[i]+x[i+1]);  
}catch(ArithmeticException e){ 
System.OUt.println("errorl"):  
}catch(Exception e){ 
System.OUt.println("error2"):  



}  
A.errorl  
B.error2 
C.errorl  
D.2 
orror2 error2 
16.下列整数的定义中,错误的是(      )。  
A.int f=314.;  
B.int a=012;  
C.int i=189; 
D.int d=0x123;  
17.要得到某目录下的所有文件名,在下列代码的下画  
线处应填入的内容是(两个下画线的填写内容相同)(      )。  
pathName=new       (args[o]); 
String[]fileNames=pathName.list();  
A.FilefnputStream B.FileOutputStream 
C.File D.RandomAccessFile 
18.在下列代码的下i画线处应填人的内容是(      )。  
public class FirstSample{ 
public static void main(        args[]){ 
System.out.println("你好!");  


A.staff B.double 
C.int D.String 
19.Object类中的方法public int hashCode[],在其子类中  
覆盖该方法时,其方法修饰符可以是(      )。  
A.protected B.public 
C.private D.缺省  
20.下列代码中的内部类名是(      )。  
import java.awt.event.*;  
lapoct javax.swin9.*;  
class TalkingClock( 
public void start(int interval,final boolean beep){ 
ActionListener listener=new 
ActionListener(){ 
public void actionPerformed(ActionEvent e- 
vent){ 
          … 


Timer t=new Timer(interval,listener);  
t.start();  


A.Timer  
B.ActionListener 
C.1istener  
D.匿名
首页 1 2 尾页

相关文章