a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 72|回复: 1

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

[复制链接]
发表于 2012-8-4 12:33:16 | 显示全部楼层 |阅读模式
 Q37. Which of the following are true about IO filters?   A Filters are supported on input, but not on output.& J+ V4 k# Q; q8 a
  B Filters are supported by the InputStream/outputStram class hierarchy, but not by the Reader/Writer class hierarchy.
) ]7 V# Y: o% I  u+ A7 x  C Filters read from one stream and write to another./ @6 @6 k9 A9 z6 v+ W$ P7 Q4 H, v
  D A filter may alter data that is read from one stream and written to another., y3 \# i( M0 C8 t& ~0 g9 g
  Q38 Which of the following are true?. {6 m5 A5 }; {! a8 I% l+ C
  A Only threads have locks.
3 p; t% a4 m, u0 y% d9 y0 e" p  B Classes have locks; J9 \+ x: ?4 {2 j3 M
  C Primitive types have locks.0 J: }  h* W) Q
  D Only Runnable objects have locks.0 h" S& q! G% M$ Q  m+ n, e
  Q39 What output does the following program display?& w! `6 O% y: e* d( z7 E7 H- L' E
  import java.util.*;/ T4 O1 ~5 z/ H/ h' W
  class Question {
6 U/ O  e! @# H, F  public static void main (String args[]) }
& E- W0 `! c* A  String s1 = “abc”;
回复

使用道具 举报

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

2011年JAVA认证模拟题(13)

</p>  String s2 = “def”;- M& _' F8 {, S: G
  Stack stack = new Stack();  L& s5 n  ^0 l& R
  stack.push(s1);3 M5 R4 m1 P) V
  stack.push(s2);
& N$ U, G# ~# G) E: X* S0 f  try {& g& D+ Y+ P! Y! X% _
  String s3 = (String) stack.pop() +
. p" w1 `/ v8 ^* g: t/ y! G  (String)stack.pop();
4 m  }  ~- E5 m! Z  System.out.println(s3);7 x: F3 h+ ^  E& S* d+ m% v* D0 v3 M
  } catch(EmptyStackException ex) {
; V* A1 J: V8 c# U5 v  }3 e+ Q6 |2 |; h7 C
  }$ k! `6 G: x2 y3 ]+ P8 a) Z
  }
( v6 i( w# N, [  A abcdef
3 s0 j2 a9 t7 F! G+ h* A' I  B defabc
2 l$ D, h7 u& w  C abcabc8 J* a5 E0 o% V' @
  D defdef
4 d$ e0 i! @3 W( M) `% A6 K  Q037 CD  u3 F) y" A% X
  Q038 B
8 O8 r6 I% Y1 m) B9 u; z1 A$ I% w  Q039 B
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-19 05:02 , Processed in 0.181507 second(s), 23 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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