a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 100|回复: 1

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

[复制链接]
发表于 2012-8-4 12:33:16 | 显示全部楼层 |阅读模式
310-025精选题(32)的具体内容如下:5 N0 p' V3 J; B, F8 x
115. A question about the GridbagLayout. One alternative., R3 s# ?" b2 n1 @6 F
116. You have been given a design document for an employee system for implementation in Java. It states.0 q. C* W6 R* u2 V
An Employee has a vector of bla bla, dates for meetings, number of dependants (what is this???)
. y9 X# A3 a- @: P2 ~; a9 ]2 `+ }A. Vector
% X$ T' x( \3 d+ l" oB. Int0 V9 z& ?! X& I& W; A; g. F3 N- _
C. Date
8 Y, S; Y! P1 ]D. Object
6 V& B, T7 Z; X  w; L/ S/ R8 s4 AE. New employee e;
/ |% t3 ]" q7 S9 ^6 G/ FWhich variables should you use?
( J9 u& l8 Q) S, S* P8 bAnswer:: m4 i* w, {% ^9 F; z9 n
A, B, C. (Not sure. Don't remember exactly how the question was posed)
3 O) A% h6 \8 G. \0 @117. You have been given a design document for a polygon system for implementation in Java. It states. A polygon is drawable. You must access it. It has a vector and corners bla bla5 t: ~# q1 b/ l- `! Q+ n5 @$ d
choose between the following words: What will you write when defining the class?
; E) f1 o# a3 [# \* tpublic
; s4 }; F6 K! Kclass
/ o7 k2 Q2 t, C4 Z5 i" \+ K7 EPolygon
7 n7 `3 {: ^6 E/ xobject+ Z/ s) K7 F. s' `
extends0 @- c' H2 @3 e: |) k. b$ ]  L
Shape# F0 _! c5 a' ]! n1 s
drawable! }8 b" @4 T. M+ ^( C
plus some more
2 [8 ?" M& [( N& G  U4 @8 aAnswer:
' T, @3 M. ~# ^1 d( z4 K% j( _public class Polygon implements drawable
: r' H- R8 l# Y2 D118. A question about stacks. Only one correct answer.) J. C! P# j5 w. y. t0 v3 [
A. (Is it possible to have stack objects in a String) Code contained + "" + stack2 + "" +' x: @8 g# k! c5 i
B. (Is it possible to write stack1 = stack2;)  m. {2 R+ R! R; z9 T3 u- O
C. Prints bla bla bla0 q/ M. p; A3 |+ q! E
D. Prints bla bla
# F: J: W6 D+ Z" d2 HE. Prints bla bla
6 y; D# p$ e; ~) V119. Threads: Which statements are true about threads stopping to execute?
& B3 @4 X  s4 a5 `) S7 u( n( E& g3 w" yA. All threads in the same class stop at the same time
) M* r8 D% o& @4 D6 RB. The suspend() method stops the thread so that you can not start it again) }$ z! A2 {8 M8 q: y3 o
C.
3 t; {& \9 f8 D( A$ Z& dD.
) r0 z. G, @- @% T4 L8 {C or D.
回复

使用道具 举报

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

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

120. Which statements are true about garbage collection?  U: }! P% {5 h7 |
A. Garbage collection is predictable.1 M/ Q' N( q& E+ `, H9 f" v
B. You can mark a variable or an object, (telling the system) so that it can be garbage collected
+ R: a1 n* n' w4 NC. .....- c- c* j; K- s/ K+ t5 W. Q1 N; S
D. .....
4 C7 Y6 h4 J- j$ c7 ^9 M7 vC or D.(not sure)
. O9 J" G/ Z9 g1 Y% D2 k% r# M8 J121. Consider the following code. What will be on the output. No Exception is thrown.
. r" U, u) t2 x" J- Q8 O+ U' fpublic class Mock2ExceptionTest{/ q% s7 A6 J4 w9 d% n
public static void main(String [] args){9 `2 t" s) v$ D2 u1 V
Mock2ExceptionTest e = new Mock2ExceptionTest();$ ^3 Q$ e3 A* o1 d
e.trythis();9 @) i! Y/ u. a  @* N3 z  ~
}* k! v2 s  ?) M- z: \0 G( ^
public void trythis(){( l& G+ O+ L9 _+ X
try{  r) }# G/ n7 y4 T" q
System.out.println("1");
& K4 \6 F7 ?- G' R4 R  Bproblem();; c+ I1 l) T1 _6 ^$ E
System.out.println("1b");
: y6 a4 q9 l/ d& d- Z& d# L/ z) O& H, _}
; x7 K$ ?. H& I* N1 c7 L4 Qcatch(Exception x){  M! o, {) S3 K" S& k! z
System.out.println("3");
" _# @! D, z* H" V8 |* m0 n}& Y, D6 v  t7 \: ?/ L% u
finally{
0 R+ ?& O$ Z7 K" z1 @* @% G; LSystem.out.println("4");! D( W8 k% ?! d/ P* ^
}& h8 m" w" f6 `
System.out.println("5");
3 K6 M8 S7 Q1 i- Z9 I* B}% U1 p# Z$ i" P
public void problem()throws Exception{7 v3 y, @3 Z: l5 h! I1 d6 P
//throw not any Exception();4 \# u" |% ?' {. l
}; Z* }4 X9 G4 z: F- W( w
}
1 Q: A# d1 I' b- w" F# g' eA. 1
4 X/ c0 ]& s! w6 [0 nB 1b0 S0 v% g) K2 y) u8 P8 t
C. 3
# B/ E9 [) V1 JD. 4& X5 ~8 L" Q3 B; S$ ~
E. 5/ ]" m6 `% |6 H1 u* z+ S
ABDE.
0 Z. ?' ]0 Z; ]5 _$ kNo exception is thrown and everything except 3 will be printed.
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-2 14:44 , Processed in 0.225798 second(s), 24 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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