a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 73|回复: 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./ }0 L) {+ j# n' @5 \" [9 C
  B Filters are supported by the InputStream/outputStram class hierarchy, but not by the Reader/Writer class hierarchy.
; o% ~# [9 F5 s, F% Q  C Filters read from one stream and write to another.0 G( l: z* t! p# k5 O
  D A filter may alter data that is read from one stream and written to another.
3 m; D  t3 o& J; d  Q38 Which of the following are true?6 l- {; a7 M8 o7 _* K% H3 [) H* M
  A Only threads have locks.
' B6 x8 C6 r- }. Q( m. |  B Classes have locks
. [+ {- a4 E, q0 E  C Primitive types have locks.
, E2 d& i' J) A. c3 m" V! k' V; b  D Only Runnable objects have locks.6 X# F& P) q8 ]& I& z3 m* j
  Q39 What output does the following program display?# X/ K7 k! J5 P- {
  import java.util.*;) B" {+ C; v+ m, z' M% d: ?' k1 \
  class Question {( _3 K4 D9 D) r# J! Y2 Z- @
  public static void main (String args[]) }
+ R/ u0 r7 C  U. c) D  String s1 = “abc”;
回复

使用道具 举报

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

2011年JAVA认证模拟题(13)

</p>  String s2 = “def”;
0 ]) q1 c5 G7 c) Q- f. C6 P8 \  Stack stack = new Stack();$ Z+ w/ A9 q( @% T, B6 y
  stack.push(s1);
; }) E; U: @" n! d5 I) ?; `# c  stack.push(s2);
" D. G$ D0 a/ a3 Z* M, Q( j' t5 ?  try {$ f- O+ X" ]9 C0 V9 f* b: n
  String s3 = (String) stack.pop() +
* p, R' U* ^7 Y6 V7 o5 p4 N  (String)stack.pop();& M0 ^" Y4 d: P8 c) q6 J& X4 ]
  System.out.println(s3);+ l- v( O3 V- I
  } catch(EmptyStackException ex) {2 e* i! w6 M8 q% X; Q  w
  }
4 x! x3 `2 R, F  }, O; N6 v3 i; V8 C7 T% q( m
  }, P; ]( j8 Y8 s7 M8 I
  A abcdef
) l: F  o# Z1 n$ F$ E  B defabc
' S  M) h4 c. b9 b  C abcabc. e7 ~/ {- b7 y! ^2 i1 {4 W) F
  D defdef
- r# j, b* Q! z+ R% T& n  Q037 CD
5 O- g' [  \) T" a  Q038 B
. X0 u3 ^4 s. z/ k  Q039 B
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-10 16:14 , Processed in 0.262112 second(s), 23 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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