a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 69|回复: 0

[考试试题] 2011计算机等级考试二级Java模拟试题6

[复制链接]
发表于 2012-8-4 12:33:16 | 显示全部楼层 |阅读模式
2011计算机等级考试二级Java模拟试题6
- f9 |: S' E) d" f8 X# {31.当浏览器重新返回 Applet 所在页面时,将调用 Applet 类的方法是____。& p( |) ~# [/ D2 I" k* J
  A、start()
7 m2 @7 c+ h4 ?/ m5 H4 T  B、init()$ b' Q$ [) L6 O( ?0 Z( m. b/ O
  C、stop()
# k8 M4 j! A4 N4 }* b+ s4 q; f  D、destroy()6 M, H. ]5 ~1 Q  K! A" b. R# y- w
  A       B       C       D
. p( u8 ~/ V; E0 e9 ^0 `  32.按照 Java 的标识符命名规范,下列表示一个类的标识符正确的是____。( ^, K3 U5 a2 U
  A、Helloworld
* ]2 k" x  L( w  I6 `  B、HelloWorld& L( I* w( D7 j) J5 x0 I" [0 i4 R
  C、helloworld
( s4 [2 x# m* o8 S  D、helloWorld# J3 d3 ?% ^6 k
  A       B       C       D
( C  O- {0 d7 ^, }  33.下列代码中,将引起一个编译错误的行是____。( j" N  p* j* _
  1)public class Test{
3 T9 k* a7 Q8 f% \- d  2) int m,n;) x; s3 Q, x' \' z3 D
  3) public Test(){}
# ?2 W$ c* p+ A- L  H  4) public Test(int a){m=a;}% u" g  t6 B# t) @$ Y6 p3 }
  5) public static void main(String args[]){7 g  ?5 ~, |1 q! w
  6) Test t1,t2;6 E6 g7 N2 c0 c, Y' a* U
  7) int j,k;
/ r6 u% ?# W4 \: L2 i# E- `$ l  8) j=0;k=0;% ^% C: i4 J8 n# O: {9 W! q
  9) t1=new Test();$ d+ o$ x& N$ K  e* V+ a3 k
  10) t2=new Test(j,k);
) O, C" N% e' `$ I4 d/ c9 _/ \  11) }
. T! V' y  }- ?0 f  12) }4 r0 M  \/ y4 L' I3 N  e! N; _
  A、第3行
0 B. @( Y) g" i4 ?  u1 K) h  B、第5行
0 E3 q: n5 C- k  C、第6行
- \) d7 T+ d2 P/ k5 Y3 N$ _* F# u  D、第10行
3 d; R8 A9 \) l6 a4 Y  H3 O! G  A       B       C       D
# I' |" V6 ]" t' G  34.下列程序的功能是在监控台上每隔一秒钟显示一个字符串“Hello!”,能够填写在程序中下划线位置,使程序完整并能正确运行的语句是____。4 C$ l, V) A5 X5 @
  public class Test implements Runnable{5 l, J& F4 U2 E/ A4 B0 ?+ L
  public static void main(String args[]){/ Q: Z5 Q/ A9 n0 v5 h
  Test t=new Test();
  V  `& t& O( U8 g. x! I  E4 M3 m  Thread tt=new Thread(t);
4 Q6 C+ g. z$ H" Y8 a/ p  tt.start();
! z1 Y: v4 m! W; N5 n  }
2 P2 ]  k0 R8 ^1 f+ a- N+ w- u  public void run(){9 k% }; @4 K& O) R, Y- C" K
  for(;;){) t0 ~2 s0 P& w; [
  try{
/ t, s$ i/ ^) g  ____;$ [# q9 S: d& y  Y& r
  }catch(____ e){}
  D) W$ |2 n9 O. m4 J$ t2 m  G  System.out.println("Hello");
+ P9 B4 d0 h, E5 q1 f, g6 K3 @: A$ I  }+ z+ v3 _/ D' u- v
  }/ M! ?  }6 K* e3 H: x6 T: W
  }
- E$ Q5 s% j) O+ p9 k5 Y  A、sleep(1000)  }- ~# }3 B* O
  InterruptedException
, Z# T7 t4 Y1 Z/ s  B、t.sleep(1000)1 I2 t3 O7 p# X( x; l
  InterruptedException4 t2 Y! a+ @1 E7 S% k5 }# J$ G
  C、Thread.sleep(1000)' N4 K; U: @- @" i3 f5 X6 p
  RuntimeException
; P  n& }) h# J. Q  D、Thread.sleep(1000)
+ n- l1 j# ^5 _( b/ h1 B  InterruptedException& N1 b7 Z% d, T6 ~5 L* R5 w. A
  A       B       C       D
9 Q. }7 S- c2 y7 M; B* W' [0 |  35.阅读下列代码后
9 A6 J0 b) {- ?  public class Person{- M5 P' r! ~1 p! V
  int arr[]=new int[10];2 r* T( i& T1 F0 P( N
  public static void main(String args[]){
1 X7 L) \8 h9 U# F& j+ |2 g4 D3 P- t; O  System.out.println(arr[1]);
* D$ q1 \! F& k  `( y; ^  }
/ H- o( n4 a; R# c4 |* h  }
& V- y! k4 [( s' G' h) K  正确的说法是2 s7 `5 ~7 n% j3 d* t
  A、编译时将产生错误
9 p8 r) L0 C( u5 x- ]) V% T7 G  B、编译时正确,运行时将产生错误
! F1 ^" B  {- p; m/ M  C、输出零
! v5 \; E5 L& [, ~' G& o6 ^9 z  D、输出空
# @4 f! |. J4 z- J( @" H  A       B       C       D
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Woexam.Com ( 湘ICP备18023104号 )

GMT+8, 2024-5-22 05:42 , Processed in 0.333199 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表