a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 72|回复: 0

[考试试题] 2011年JAVA认证模拟题第二阶段(14)

[复制链接]
发表于 2012-8-4 12:33:16 | 显示全部楼层 |阅读模式
  Q40.Which keyword, when used in front of a method, must also appear in front of the class.  a. synchronized; L- h1 Q8 @$ K5 F( U( O. W% W
  b. abstract
( c# m9 s* S+ x/ u  c. public" [, D! b0 [# ]8 M
  d. private
( u' k& I8 p# K* h: B+ q  Q41.Given this code snippet,) Q4 J/ e& R6 j+ R. a
  1. try {9 k, G% Y* z$ j$ C" y7 W
  2. tryThis();- E* J* K0 V2 D& }4 M$ ?
  3. return;
/ Q! n! q! b+ d3 S7 s2 }1 a  4. } catch(IOException x1) {: h/ v" p' b" o" F5 ?7 L$ @
  5. System.out.println(“exception 1”);8 m: _2 L3 X5 A
  6. return;4 N9 E/ X- s2 I! l: i
  7. } catch(Exception x2) {  N* X4 l9 Q% M) w1 q
  8. System.out.println(“exception 2”);
0 p( j0 {3 F# a; m) B; G9 k# J8 |% d  u  9. return;/ Z3 S' H5 i  l# @0 H, A
  10. } finally {3 w; U5 M$ S' B, n  [9 L; q
  11. System.out.println(“finally”);: q% ]+ ?! r4 z8 C! `6 W9 \- O
  12. }
, \/ k( w0 g% v- w1 v+ @  what will appear in the standard output if tryThis() throws a IOException?
( P3 j: X6 {) j' D7 O, I  a. “exception 1” followed by “finally”
/ Z! L; o7 F( R/ f  b. “exception 2” followed by “finally”! t: s8 Q% U# F4 g
  c. “exception 1”4 i* l9 r5 G2 R2 j, y2 Y# `, [
  d. “exception 2”5 f2 B& l, n! F
  Q42.Given the code snippet,
4 j) x- e- J) r0 T5 t% I: `; `# u  1. double a = 90.7;5 L. R6 J  t& J% H) k# j
  2. double b = method(a);5 \; M, A) M) e$ S$ [
  3. System.out.println(b);& n, V( B$ O( e3 M
  if this snippet displays 90.0 in the standard output, what Math method did method() invoke? Select all valid answers.
" R( W3 u. U3 o  d) `; P; f  a. abs(). z6 I7 X) x0 j+ g) t8 R& u
  b. round()! o3 x6 A9 ^; i7 J4 O
  c. floor(). h  d" s* j4 \6 a& q$ W, N  ?5 M% ^
  d. ceil()1 Q* b  L) X# ?0 p! y+ |
  40. b
4 \# @& l1 ]; Q* x/ Z8 b  41. a  _" y" K' J' z! H. ]9 K! ?- ?
  42. c
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-21 10:20 , Processed in 0.433703 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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