a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 95|回复: 0

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

[复制链接]
发表于 2012-8-4 12:33:16 | 显示全部楼层 |阅读模式
60. Given a TextField that is constructed like this:
0 [4 s" G3 [  ?# g& TTextField t = new TextField(30);& f0 o' N! \* m( \
Which statement is true?
% u$ p( |+ Z$ a0 ]! |A. The displayed width is 30 columns.
1 v0 p& \) \- s( Y, }  j. bB. The displayed string can use multiple fonts.) F1 Q/ y0 M8 a  I' C
C. The user will be able to edit the character string.
1 C% Q' {- |' j" m( OD. The displayed line will show exactly thirty characters.
$ ?/ E' q; F' t. T& a6 dE. The maximum number of characters in a line will be thirty.% ~( A# z' a3 V6 r( N0 Y$ G
AC.+ A6 W( `* W* ?% E) I# ?6 \
61. What does the java runtime option -cs do?
7 I/ C3 T6 ^! i9 x. |A. check source with debug report! V% @9 n& @* M! W7 n1 X' n
B. clear classes that are existing when starting compilation.; H% i; T6 D+ }8 |, o; n
C. check if the source is newer when loading classes.
5 V+ I" f7 @5 _7 |; \# P; L62. When is an action invoked?" l  L9 e9 z# W
A. TextField Enter
5 ?8 W6 s' g6 y7 a/ z* a% U0 FB. TextArea Enter
! x  q8 z" T5 e( m8 rC. Scrollbar; V% U7 s3 J. z
D. MouseDown
& Q! f5 N& f; eE. Button* S- r0 e( p+ e
AE.
, g! [& F0 q' r" U. i4 _( Q63. What error does the following code generate?& @) Y/ j+ \: r2 ]
class SuperClass{) `9 F- v7 W' D& {* G  u
SuperClass(String s){}& m; b6 w" c/ g) X- E7 n
}% k* d9 `2 b- W) q5 Z5 ~0 x* h
class SubClass extends SuperClass{
: z5 h' ~, f/ `9 k5 X+ t4 b( nSubClass(){}3 B8 \- J4 E- X9 V/ k  {3 C$ O
}
' G4 d& d* \& H......
; }* m% [3 D% r) Z, h7 S! t, YSubClass s1 = new SubClass("The");
, F  K1 n9 E9 w2 Y- dSuperClass s = new SubClass("The");, q3 X+ A9 h' `' ?0 |
A. java.lang.ClassCastException+ q5 P4 w  [3 s$ N; g4 ^( X
B. Wrong number of arguments in constructor0 r4 C4 o* K, C2 v
C. Incompatible type for =. Can't convert SubClass to SuperClass.9 x7 b7 L1 v; D! L( Q" H7 D" J7 {; x  Q
D. No constructor matching SuperClass found in class SuperClass.
9 K' n8 F  s6 r+ Y& o" r( K% C9 p0 f$ nBD.
8 }$ e; k5 d" i2 c' B" j64. How do you declare a native method called myMethod in Java?! s) `3 g8 ~9 |; V  `) I
Answer:
+ s/ h- \( Z0 F: [public native void myMethod();
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-19 04:10 , Processed in 0.175658 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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