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. |