a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 250|回复: 1

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

[复制链接]
发表于 2012-8-4 12:33:16 | 显示全部楼层 |阅读模式
 Q82 What is wrong with the following switch statement?   switch(i == 10) {! I- m: I! i5 u4 `, H- v
  case ‘1’:
: {8 e3 r  I7 v  ++i;! C7 t$ P7 D* ^! \, A. Z' x* q
  break;
$ ~2 E2 ]5 H; A5 A  case “2”:3 v/ E# D; o2 w5 r& X$ ?% K% k
  --i;: L) b! C9 m" n# K/ m% ^5 N' L+ c
  case 3:
% r+ }" R' ^2 f" u  i *= 5;0 r1 Y7 H! _4 }) F' m& Q
  break;
. u  k1 g8 M$ i) Z1 L1 f  default:
* N8 s$ X5 }0 E) v  i %=3;
# p/ h+ a. H' {7 |  }
( h6 ]3 l+ s+ `, Z/ n5 \  A The switch expression must evaluate to an integer value.; o$ N1 M: O! D8 _, G. k3 c: p/ C
  B The first case specifies a char value.
7 }/ t; h  n# \# ]/ _( x  C The second case specifies a String value.
/ V* z) y  ~& @7 k  D There is a break statement missing in the second case.$ ]( n+ r7 g! T" O% j  [1 L* Y% Q
  Q83 What’s wrong with the following code?
5 o' @8 s/ d1 y0 A3 {+ w  public class Question {
回复

使用道具 举报

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

2011年JAVA认证模拟题(28)

</p>  public static void main(String args[])
4 u8 }) O# Q! [! ]5 B: P  {
/ A" m& z' i6 a$ c( @  Boolean b = new Boolean(“TRUE”);
6 L6 p/ t4 i4 k% \, x6 \  if(b) {; D8 W1 }  C" @* E

# B8 e8 m/ k+ k0 P% h4 T& Y( ^. ^  for(Integer i=0; i
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-21 13:12 , Processed in 0.138755 second(s), 23 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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