a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 88|回复: 0

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

[复制链接]
发表于 2012-8-4 12:33:16 | 显示全部楼层 |阅读模式
95. Which of the following statements are true?
! g$ c8 ]# b& D& vA. For a given component, events will be processed in the order that the listeners were added
% ^8 ]9 @) P( C' k- S, N9 F* i% {& [B. Using the Adapter approach to event handling means creating blank method bodies for all event methods
0 a: U$ C% J. _  r6 FC. A component may have multiple listeners associated with it' d% Z- W2 [$ U, L- ~
D. Listeners may be removed once added2 x( {0 S9 A6 `6 [+ U% n+ S. i
CD.(maybe B) Not sure what they mean. If you code like this: class A extends MouseAdapter then class A will inherit all the methods in the MouseListener interface. And all of these methods will be empty. Of course these methods can later be overridden. Maybe some with english as their mother tongue can determine this. Button for instance has the methods addActionListener (ActionListener a) and removeActionListener(ActionListener a).5 x/ M( S) |- j) t1 y0 {7 P
96. Which of the following statements are true?/ ^, v9 o5 }. Z
A. Directly subclassing Thread gives you access to more functionality of the Java threading capability than using the Runnable interface3 g$ i7 Y0 t& ]  q3 i( ~
B. Using the Runnable interface means you do not have to create an instance of the Thread class and can call run directly
8 f! Y; c9 F/ L8 \2 X; ?C. Both us ing the Runnable interface and subclassing of Thread require calling start to begin execution of a Thread
3 S% z' f, W% V) V5 s6 C1 R! b  mD. The Runnable interface requires only one method to be implemented, this method is called run
  v& b; H2 O, {$ U, T& eCD." D# v/ y2 C: @- s% V' D. F* U0 D
97. If you want subclasses to access, but not to override a superclass member method, what keyword should precede the name of the superclass method?' x" c" q# t  Y! D* i. N
Answer:
7 ~( G  `# s+ p1 E; n% cfinal3 Z. H+ t4 n) t8 M8 e! |7 A1 Y
98. If you want a member variable to not be accessible outside the current class at all, what keyword should precede the name of the
' b1 ^" c2 X8 t7 N  X) d5 kvariable when declaring it?
. }; u( k; `$ R+ hAnswer:
+ v3 ]% l; R( g( Qprivate6 J: c  V3 c6 k; C$ t
99. Which of the following are correct methods for initializing the array "dayhigh" with 7 values?
, V! I; s; L: `+ wA. int dayhigh = { 24, 23, 24, 25, 25, 23, 21 };
* O6 K2 u  e/ q5 ]% y+ e+ o$ JB. int dayhigh[] = { 24, 23, 24, 25, 25, 23, 21 };) L7 V. y' d& G& M# U
C. int[] dayhigh = { 24, 23, 24, 25, 25, 23, 21 };
1 g! z. v2 w& R1 ]. Q, {D. int dayhigh [] = new int [24, 23, 24, 25, 25, 23, 21];
4 s  U) `# d! M- J2 S( Z0 uE. int dayhigh = new [24, 23, 24, 25, 25, 23, 21] ;
$ h/ _& m, v9 W. O1 s. ]BC.
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-19 06:00 , Processed in 0.166837 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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