a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 116|回复: 0

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

[复制链接]
发表于 2012-8-4 12:33:16 | 显示全部楼层 |阅读模式
  Q67.What happens when this method is called with an input of “Java rules”?$ b$ K" j4 c8 M! `7 B
  1. public String addOK(String S) {
, v* X4 E" ?  a# }8 n- O  2. S += “ OK!”;# K) l: @4 I* T; M
  3. return S;0 n1 S* c1 T6 R  j
  4. }
% {/ v# ^! _. n/ X: T+ c1 E  Select one correct answer
" G$ ~, p2 a8 n) n5 c  a. The method will return “OK!”;; _+ g: U, e+ B+ v
  b. A runtime exception will be thrown.
+ t7 }: f' a% e% o  c. The method will return “Java rules OK!”.
2 c9 Q' c: g# b3 }' }  d. The method will return “Java rules”.
4 ?! [: t- n+ _9 u: k& B  Q68.What happens during execution of the following program?" F2 F8 q4 Q6 y& Z# T- J
  1. public class OperandOrder {
. ~; x; O# @: D2 O  2. public static void main(String args[]) {
, q8 S( t' l; v. V  3. int i=0;
" b$ S$ O& }1 q  4. int a[] = {3,6};
0 F% q) |* }  Z) b( n9 V, |8 x  5. a = i = 9;
  S, S8 w9 h$ L8 h, i  6. System.out.println(i + “ “ + a[0] + “ “ + a[1]);+ w+ f# c  X; ~! s2 t
  7. }/ o. t9 A9 m' A0 u7 z! A5 v
  8. }( \. Z9 J# Z# `# \7 H+ [5 k, o8 ^
  Select one correct answer.2 M, j4 B6 v* U/ r
  a. Raises “ArrayIndexOutOfBoundsException”.
& L/ U( O7 l' F( ?$ g1 S  b. Prints “9 9 6”.  x0 f9 `# S1 P; S
  c. Prints “9 0 6”.; K4 e7 O% c4 ^6 ~% G0 B! n
  d. Prints “9 3 6”.
# y  ~* K( p( n7 N. ?  Q69.Which statements about the output of the following program are true?
3 i6 W0 B. x- f+ _" G7 P  1. public class Logic {$ O! B  Y1 C1 G8 ]) Q
  2. public static void main(String args[]) {
' ^* y6 v2 L% c- S$ b% ^8 K  3. int i = 0;: u/ h/ e% }; m! O
  4. int j = 0;) f, W3 U0 c7 j8 k$ x# m
  5. boolean t = true;  b% T1 g* Z2 D
  6. boolean r;6 T$ E& Y5 C0 g  p: X" `

: I7 N2 P) [  b) E+ @% D% y* O4 [  7. r = (t & 0
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-22 00:04 , Processed in 0.177133 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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