a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 125|回复: 1

[考试试题] JAVA认证历年真题:310-025精选题(41)

[复制链接]
发表于 2012-8-4 12:33:16 | 显示全部楼层 |阅读模式
310-025精选题(41)的具体内容如下:
- y7 t) T( w' S* h  d- F# z182. What type of object is the parameter for all methods of the ActionListener interface? Answer:( t& r! E1 j+ Y7 s, E
ActionEvent$ ]$ P4 u* f; ~" t2 i  F
183. Which of the following statements about event handling in JDK 1.1 and later are true? Select all.
6 R, i6 q/ b) _4 f1 r( z3 f4 TA. A class can implement multiple listener interfaces
4 F- @" u! E" D. yB. If a class implements a listener interface, it only has to overload the methods it uses
7 {. y: u+ C. M2 w7 {C. All of the MouseMotionAdapter class methods have a void return type/ s7 ^! Z# h! ]- k6 S, `. p
AC.
6 y/ h+ y; z% N% M% Q! }184. Which of the following describe the sequence of method calls that result in a component being redrawn?
. f; t5 T  P. cA. invoke paint() directly
- z5 m, R8 E/ m/ i- f5 b% ]B. invoke update which calls paint()
2 h/ M8 `8 n3 E" y$ rC. invoke repaint() which invokes update(), which in turn invokes paint()
3 }. ^: m% P. XD. invoke repaint() which invokes paint() directly2 K( D5 ~2 a, o! O% W- D5 g
C.
" M0 f8 V9 ^1 N185. Choose all valid forms of the argument list for the FileOutputStream constructor shown below:3 X6 G; W/ A" Y& l9 a/ b
A. FileOutputStream(FileDescriptor fd)( O8 w9 R: N) r; M3 @9 Z
B. FileOutputStream(String n, boolean b)8 M4 D: a/ p5 d5 y$ ]: Q" e- X
C. FileOutputStream(boolean a)
8 C% ]" o; ]* _5 C6 R6 G  {D. FileOutputStream()7 x9 g# g( G5 E# m* n% J) X( t8 Q
E. FileOutputStream(File f)7 N0 ^) W6 g; N. Q1 h
ABE.% a- w6 j, w$ M, T- o7 i6 F! |
186. A "mode" argument such as "r" or "rw" is required in the constructor for the class(es):
5 N6 y* c( e0 m1 q' @1 A( HA. DataInputStream
& b" e- Z3 I$ uB. InputStream
: |$ o$ f% K4 m; z- T8 W8 v  aC. RandomAccessFile
6 s9 O* y' o: Q# W: X4 D# UD. File0 y1 h; \8 N- \. Z/ j' R0 c: O! y( C
E. None of the above: e% T6 s5 H" ~( ?4 t0 w) E+ y9 y
C.7 t9 f5 |" P8 p' G
187. A directory can be created using a method from the class(es):# V* i* ]+ q3 J) h: ^4 Y
A.File
' ?  j9 v9 X2 @4 n$ N& |& QB.DataOutput
  a7 U1 L  A" L/ SC.Directory
( `- x' L  n3 Y/ W6 A6 TD.FileDescriptor, r6 `+ d4 i; `  v1 a
E.FileOutputStream. {/ A2 L: c9 I! [. G# H9 K
A.
# x0 b- C+ N! X5 O2 }& \- W7 s188. If raf is a RandomAccessFile, what is the result of compiling and executing the following code?
" a$ M* _" m4 xraf.seek(raf.length());* _1 S' }) C5 W6 j/ q- _4 c
A. The code will not compile.0 y/ Q# T" F: N6 S/ F
B. An IOException will be thrown.; \9 S5 j7 @' @
C. The file pointer will be positioned immediately before the last character of the file.2 w% ?/ k7 n+ k; _& D
D. The file pointer will be positioned immediately after the last character of the file.
3 e. H9 A4 Y1 j1 i4 `* b  |: g. PD.
回复

使用道具 举报

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

JAVA认证历年真题:310-025精选题(41)

189. Consider the following code: What will be printed?+ F7 }, s" o) s1 c" s& x
public class ExceptionTest{; o: ?  Y# y8 H; q# C. `4 I$ e
public static void main(String [] args){
0 h* v% v! U& C* bExceptionTest e = new ExceptionTest();  [5 D/ L. O% j5 o/ W- _0 O
e.trythis();! b' i! k% K9 S( A
}4 k$ \, T  m# X- U* L0 S
public void trythis(){1 d+ ]' t, H6 j9 c6 x
try{' H+ o3 A8 Z. J% c
System.out.println("1");
: x  l& G3 A% }2 u; b, r8 O8 mproblem();+ F0 {3 h4 o" C9 S
}% Q6 ]% }/ Z. Q8 z5 l  H& C
catch (RuntimeException x){
. s: Q7 k8 x$ h( |# H& ISystem.out.println("2");$ D  c7 t  J3 |, o
return;
* \) B$ l6 R2 W. u5 s3 J) o}
  [" e' J+ m- y0 Q" `( xcatch(Exception x){
2 p9 i' |5 O+ C9 W/ g* p2 h: \System.out.println("3");, F. y9 z. _3 {% T3 `0 s# F% ^
return;7 T+ G1 E) I6 P* p9 e$ Y* K
}) o# z" {) R1 U8 S
finally{6 T/ q/ Z+ E7 [
System.out.println("4");
! W3 r" |3 y( q. {6 Z}
: }$ S3 a5 D, ]; a) ]6 F% _& t( ySystem.out.println("5");: H0 S, Z1 Q/ y- ~  s
}" Y2 T4 Y0 N( a/ |) C' |
public void problem()throws Exception{
1 G0 M! B7 H; x6 ?  h2 X8 Tthrow new Exception();
) g7 ~3 x" [$ J3 H0 ^}
& b' `4 D3 L# Z& X}
0 A# J2 Z  D8 ?A.10 C) j( i4 S2 G4 p1 E( g1 {2 c
B.26 B" _# u+ D5 ^! L/ q
C.36 m! C& S/ |( \& o% Z
D.4! P, p. M, y2 d4 U
E.5
  G& A" j: b( n+ D& QACD.
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-19 06:15 , Processed in 0.164408 second(s), 23 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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