a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 110|回复: 2

[考试试题] 2011年JAVA认证模拟题(57)

[复制链接]
发表于 2012-8-4 12:33:16 | 显示全部楼层 |阅读模式
  Q169 Which of the following methods are methods of the String class?
  }4 v" l" s" N: T; L( s7 z0 G  A delete()
4 w7 M/ }0 N: D2 m& k7 @8 q  B append()1 h0 h. b' o9 b* x" ^9 o
  C reverse()
7 W0 }! W6 ~" Y: \# J/ L! B3 @  D replace()
7 [+ o/ s/ m# f2 R# @0 h2 j, Q  Q170 What line of output is displayed by the following program?
) l. J$ v2 m5 f. f& Z  class Question {
0 ~7 c1 E  h) D5 y# W  static boolean sideEffect (boolean b) {
/ X" X- k! }% V+ a' o1 E  System.out.print(“ side effect “);
9 Y& T( u# |9 K$ V7 t6 U  return b;2 n/ t5 v! }' R+ L. a
  }. r/ u9 D7 Q; t
  public static void main (String[] args)' u( d" ]- j7 V9 {( Q
  {" Q  h" X# P0 m/ N; d
  boolean b1 = true;
9 i% o, ]6 k/ H2 v+ `) {) c  boolean b2 = false;
. I0 Z0 B  B( A  @- w' `1 M  if(b2 & sideEffect(b1))
$ }* k8 g- G& H+ V* X  System.out.println(1);" \& d3 _) {- f9 a* D2 C9 f
  else if (b1 | sideEffect(b2))
2 y. T5 P+ F7 p' P
: q( m+ A1 H* b  System.out.println(2);
回复

使用道具 举报

 楼主| 发表于 2012-8-4 12:33:17 | 显示全部楼层

2011年JAVA认证模拟题(57)

</p>  }
4 Y  @* Y2 w1 A* B# x5 x# ]! [  }
, N4 \- E6 J. c  A 1
: w& N7 v0 Z7 r' h% m. p  B 2) Y- ^& r1 W0 l
  C side effect 1' }2 G" n) R. m
  D side effect 2
' n- p6 s, h( V2 Q- `  E side effect side effect 19 ~' {! R' a& B# D- n9 O2 d: K
  F side effect side effect 2
0 [9 `; J  M% b& G. J" i! K  Q171 If you ran the following program, which lines would be included in its output?3 `( N: ^# M4 |. }7 b/ A3 ^
  class Question {
- p& O& V$ n5 I5 m$ O  public static void main (String[] args)
8 n4 J1 Z$ Y  D( x& \2 q. C( j  {
4 F% w5 R7 |5 c) ?1 ^/ s  z0 L  int i = 1;
" Q5 ?8 h" ?1 ?4 {9 \, g, s1 X  int j = 2;$ }6 n; H+ z9 L  @4 U" M
  outer: while (i < j) {+ I& r5 ?' V9 _! ~6 u; I, U2 H
  ++i;% ?( A. h% P7 C+ }
  inner: do {
) ?5 O4 L/ k! v; a5 I  ++j;* J& y# Y% q  v* w' E
  if(j % 3 == 0) continue outer;
* J8 g9 R6 t5 `- P  l* [  if(i % 3 == 0) break inner;+ ]/ A: Z2 p8 i  J2 j' ~
  if(i % 3 == 1) break outer;( Y0 Q5 B2 q% s5 r, _0 G

  s: U2 h, n3 {- w  System.out.println(i * j);
回复 支持 反对

使用道具 举报

 楼主| 发表于 2012-8-4 12:33:18 | 显示全部楼层

2011年JAVA认证模拟题(57)

</p>  } while (j < i);
& B  @# I/ q# x  Y/ P, E" _  System.out.println(i + j);$ e' G1 C# E/ S0 ~
  }; G; M6 H& H% B# s! p" Q8 L
  }; `% E$ a2 W; L; C  ?- b1 z+ q
  }, V' S* [1 Y$ N$ a8 ~9 ]$ D0 f
  A 5$ z/ e& V1 Q, e  R3 q7 f
  B 6
1 d4 c9 \" a& W$ N: w: }& o4 M  C 7
. F6 ?: J1 d6 s$ G0 A, n$ W2 r  D The program does not display any output.
9 E8 Z! Q/ V* [' [) W3 S  Q172 Which of the following java.util classes support internationalization?. v2 k5 @" @! g0 y7 d9 O
  A Locale
/ Z9 z  H* @) C  B ResourceBundle
' e# o- i7 E* W7 G, J" e4 F  C Country! Q( [3 @; K/ e2 O  \
  D Language- t; p* _1 W% K, Z' _
  Q169 D" p) J' V$ l& q7 \
  Q170 F
+ M& R: l3 e2 o0 @1 q& z  Q171 C3 A& e8 V7 L  d4 R  V' S, `
  Q172 AB
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-21 10:36 , Processed in 0.212490 second(s), 25 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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