a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 125|回复: 0

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

[复制链接]
发表于 2012-8-4 12:33:16 | 显示全部楼层 |阅读模式
  Q46.What is the output of the following piece of code  1. int x = 6;. M, O, h  `% ?! `! V
  2. double d = 7.7;% ^( z+ M: o1 I* x* P
  3. System.out.println((x>d) ? 99.9 : 9);
0 i# Z. \# p  Q+ B* P  a. 9' S1 E# d- g6 ^( r
  b. 9.0
  N: e8 l; G' _; P% o& ?$ `+ q  c. 99.94 T% }! v5 z: }; ?; i, y' q! f
  d. Nothing, an ArithmeticException is thrown at line 3.1 n. p, i1 W) V+ ^5 {+ b
  Q47.Which of the following are legal methods for the String class ?! B5 j- r6 b$ R/ W, S2 z9 ~0 g
  a. length()
. ?9 N/ l) d# Z; {7 L4 o; N4 Z" @  b. toUpper(). t6 _4 p; F& a6 [6 O8 I2 V
  c. toUppercase()/ ~) L: x% M! _
  d. equals()
& G4 w# I6 L: S% ~) `  Q48.Consider the following
+ |+ n# a; y% j/ M. U/ h, ]  1. class A extends Integer {, c" |3 i. A+ S9 E! r& K" z5 @
  2. int x = 0;: A# R( M' @  e) L8 n
  3. }
. H' U; x: j9 S  a. The code will compile correctly.
" q. d! L+ f+ n5 x" W. `  b. The code will not compile because Integer class is final.
1 M' y) n$ n3 X0 v  c. The code will not compile because A class doesn't have a constructor.
" f& ?' `- Y9 F9 B2 _2 e8 Q  d. The code will compile but an ArithmeticException at runtime.
7 W% A' k/ q. k  46. b
, A2 |7 w5 ^% G1 a9 L8 G  47. ad3 S4 G/ A! l' |, X
  48. b
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-21 22:53 , Processed in 0.247338 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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