a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 127|回复: 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;/ @: T$ f% e3 Q5 g0 X
  2. double d = 7.7;
8 Q5 n2 W$ m" e: V  3. System.out.println((x>d) ? 99.9 : 9);* Q3 H1 e* M9 m& j1 |* r& C& j
  a. 9
+ l$ h6 B, R1 q; p9 J. X+ J! Z+ m  b. 9.0
8 [6 J4 _4 |7 c' K$ O! A  c. 99.9
, s5 V$ U. O7 V. }  d. Nothing, an ArithmeticException is thrown at line 3.7 b$ A# F- ?! j8 X
  Q47.Which of the following are legal methods for the String class ?
; R2 p7 M& I; ~9 V/ t  {; l+ u. R( F  a. length()/ M& a: A- j9 _% K. @1 m
  b. toUpper()
; L5 d4 J: q9 ^! g+ x9 M  c. toUppercase()
, T- ^, r. `& y! {, ~, s  d. equals()
7 L$ m0 ]( t$ N3 e  Q48.Consider the following
; W5 J/ u; ^3 l; g  1. class A extends Integer {
' l, S( M" A9 \+ @. N' P! X7 U& [  2. int x = 0;! @6 f8 \9 D( `! B7 }+ W6 J  q
  3. }
' i2 y. r# ~+ N; Z: x( e4 }2 b6 L  a. The code will compile correctly.
8 c3 H3 R" x) q( V  b. The code will not compile because Integer class is final.
8 P2 u. ^6 H8 O. r  p1 f  c. The code will not compile because A class doesn't have a constructor.
: o, L4 S" i2 ~  d. The code will compile but an ArithmeticException at runtime.& X# Z0 L8 q5 o0 g9 O: e* {& Q1 ^
  46. b
$ |0 M! Y) @! c9 [; {; Z  47. ad) l  T% n0 ?3 \) n3 b7 J% T
  48. b
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-2 16:02 , Processed in 0.314590 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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