a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 57|回复: 0

[考试试题] Java认证模拟题及分析(5)

[复制链接]
发表于 2012-8-4 12:33:16 | 显示全部楼层 |阅读模式
question 56)
+ C+ x" t6 M- Y9 C, ]8 x# S' gyou are using the gridbaglayout manager to place a series of buttons on a frame. you want to make the size of one of the buttons bigger than the text it contains. which of the following will allow you to do that? 0 M7 |+ |& f1 K, S9 L+ X
1) the gridbaglayout manager does not allow you to do this 3 N$ K2 x" [7 X( n/ Q
2) the setfill method of the gridbaglayout class 3 S8 I0 ~0 E% M) @
3) the setfill method of the gridbagconstraints class
. X( A$ z; _& u$ z5 b8 O1 r3 F4) the fill field of the gridbagconstraints class
0 }" q. H7 k' r2 nanswer to question 56
2 O" b' \$ |4 m0 p5 M7 H& N* \--------------------------------------------------------------------------------
7 E2 z* [( M9 E$ v$ jquestion 57) # M" K: X5 _# }. |- P2 g
which of the following most closely describes a bitset collection?
6 }% G) ~6 h# E9 b1) a class that contains groups of unique sequences of bits $ t9 |! X* i- I3 w( @
2) a method for flipping individual bits in instance of a primitive type / K; a7 f! E3 l% p
3) an array of boolean primitives that indicate zeros or ones
( U; c. p& Z- m  d! a5 @& Y! U5 B; r4) a collection for storing bits as on-off information, like a vector of bits % F& _% O3 Y0 z' o* e8 Z8 u
answer to question 57
7 n- N/ K( U8 o6 w-------------------------------------------------------------------------------- ' x/ I0 u) `# c! I$ h1 \4 |0 [  v
question 58) 1 a  t9 z- i2 j$ O
you have these files in the same directory. what will happen when you attempt to compile and run class1.java if you have not already compiled base.java ) M/ e- v8 B  y* t$ S3 {
//base.java , {0 K; V( N9 y  A
package base;
! [& K% F! h% V1 T! bclass base{ ; z9 w' x9 S4 w& B5 ]
protected void amethod(){ 4 Z* y; V. K& l  x' p& I3 X) b- t
system.out.println('amethod');
  c: s7 ?+ F7 H, U$ i. M3 E}//end of amethod
, U3 q, `' G4 g: z; y/ L}//end of class base ' ]3 B2 v' z9 l  R6 f7 J
package class1; 2 `& _( I% S- M5 e5 l/ g& G  Q9 A) f
//class1.java
" b1 S* T% o2 x, a3 W0 x6 Xpublic class class1 extends base{
6 H5 o, u9 n: e1 |3 bpublic static void main(string argv[]){
, u/ z- O9 g( ~7 D) k! ebase b = new base(); . u7 f: O8 q/ \' T/ H+ x
b.amethod(); : ]: D5 ^  j0 H& m6 L+ Z
}//end of main
$ J, j; W) r  @}//end of class1 % `" i$ E: R/ Y( ~

9 A# C4 d6 i; A, D1) compile error: methods in base not found
. `, n  N" C7 G$ c( y: U- Y7 [2) compile error: unable to access protected method in base class : o, F; W; Q, v
3) compilation followed by the output 'amethod'
1 j2 h4 x& d) a! s4 h4)compile error: superclass class1.base of class class1.class1 not found
6 s) C  D4 u& a& Z" t* N( janswer to question 58 0 M5 Q- d/ _& n5 \: x
-------------------------------------------------------------------------------- 6 D' Q. o  b2 G' z( D
question 59)
. h. d2 P* J9 R$ n  ]what will happen when you attempt to compile and run the following code ) e, M" b8 [1 j1 v# E# v2 B& Z
class base{
, K8 M" J7 Z4 m) {/ Iprivate void amethod(int ibase){
5 L% o- C/ |6 d0 C- ^% Isystem.out.println('base.amethod');
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-4 14:36 , Processed in 1.996207 second(s), 22 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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