Monday, April 16, 2012

1 . W h i ch o f th e f o l l ow i n g s t a t e m e nt i s n o t d e fi n e d i n t h e Ob j e c t c l a s s ? ( a) wa i t( ) ( b ) n o ti f y( ) ( c ) n o ti f yA l l ( ) ( d ) s l e e p (l o n g m i l l i s e c o n d s )

2 . W h i ch o f th e f o l l ow i n g m e t h o d i s a s t at i c i n j ava . l an g . T h r e a d ? ( a) s l e e p (l o n g) ( b ) s t a rt ( ) ( c ) r u n ( ) ( d ) j o i n ( )

3 . Yo u c an n o t c r e a te a b l o ck i ng q u e u e u s i n g . ( a) A r r ay B l o ck i n gQ u e u e ( b ) P r i o ri ty B l o ck i n gQ u e u e ( c ) L i n ke d B l o cki n g Q u e u e ( d ) P r i o ri ty Qu e u e

4 . A J ava e x c e p ti o n i s an i n s t an c e o f . ( a) E r r or ( b ) T h r owa b l e ( c ) R u nt i m e E x c e p t i on ( d ) E x c e p t i o n

5 . W h a t e x c e p t i on ty p e d o e s th e f o l l ow i n g p r o gr am t h row ? p u b l i c c l as s Te s t { p u b l i c s t at i c vo i d m a i n (S t r i n g[ ] ar g s ) { S t r i n g s = “ ab c ”; S y s t e m . o u t. p r i nt l n (s . ch ar At (3 ) ) ; } } ( a) A r r ay I n d e x O u t O f B ou n d s E x c e p t i o n ( b ) S t r i n gI n d e x Ou t O f B o u n d s E x c e pt i o n ( c ) A r i t h m e t i c E x c e p t i o n ( d ) C l a s s C as t E x c e p t i on

6 . W h i ch o f th e f o l l ow i n g i s n ot an a d va nt ag e o f J ava e x c e p ti o n h a n d l i n g? ( a) E x c e p t i o n h a n d l i n g i m p rove s p e r f o r m an c e . ( b ) J ava s e p a r at e s e x c e p t i on h an d l i n g f r o m n o r m al p r o c e s s i n g t as k s . ( c ) E x c e p t i o n h a n d l i n g m ake s i t p os s i b l e f or t h e c a l l e r’ s c a l l e r t o h a n d l e t h e e xc e p t i on . ( d ) E x c e p t i o n h an d l i n g s i m p l i fi e s p r og r am m i n g b e c a u s e t h e e r r or - re p or t i n g a n d e r r or - h a n d l i n g c o d e c an b e p l a c e d a t t h e c a t ch b l o ck .

7 . C l i ck i n g t h e c l o s i n g b u t t on on th e u p p e r - ri g ht c o rn e r of a f r am e g e n e r at e s a (n ) e ve nt . ( a) W i n d ow E ve nt ( b ) C o m p o ne nt E ve nt ( c ) M o u s e M o t i on E ve nt ( d ) I t e m E ve nt

8 . To ge t th e x c o o rd i n a t e o f t h e m ou s e p o i nt e r f o r t h e M o u s e E ve nt e vt , yo u u s e . ( a) E ve nt . ge t Po i nt ( ) . x ( b ) E ve nt . ge t Po i nt ( x , y ) ( c ) e v t . ge tX ( ) ( d ) e v t . ge tX Y ( )

9 . W h i ch o f th e f o l l ow i n g p r o p e r ti e s a r e i n J A p p l e t ? ( a) r e s i z a b l e ( b ) i c o n I m a ge ( c ) c o nte nt Pa n e ( d ) t i t l e

1 0. W h i ch o f th e f o l l ow i n g p r o p e r ti e s i n j ava. aw t . C om p o n e nt m ay e ff e c t l ayou t ? ( a) p r e f e r r e d S i z e ( b ) b a ckg r ou n d ( c ) f o nt ( d ) f o r e gr o u n d


1 1. Yo u c an c on s tr u c t a J S p l i t Pa n e u s i n g . ( a) n e w J S p l i tPan e ( C o m p o n e nt, C om p on e nt ) ( b ) n e w J S p l i tPan e ( ) ( c ) n e w J S p l i tPan e ( C o m p o n e nt [ ] ) ( d ) n e w J S p l i tPan e ( C o m p o n e nt)

1 2. W h i ch o f th e f o l l ow i n g m e t h o d w i l l n ot c r e at e an E t ch e d B o r d e r? ( a) B o r d e r Fa c t or y. c r e a t e E t ch e d B or d e r ( C ol o r . Y E L L OW , C ol o r . RE D ) ( b ) n e w E t ch e d B o ar d e r ( ) ( c ) B o r d e r Fa c t or y. c r e a t e E t ch e d B or d e r ( ) ( d ) n e w E t ch e d B o r d e r (C ol o r . Y E L LOW , C o l o r. R E D )


1 3. A J R a d i oB u tt o n M e nu I t e m is a s u b c l as s o f . ( a) J M e nu I t e m ( b ) A b s t r ac tB u t to n ( c ) J M e nu ( d ) J C o m p o n e nt

1 4. i s u s e d t o r e c e i ve i n p u t f r om th e u s e r . ( a) A n i n p u t d i al o g ( b ) A m e s s a ge d i al o g ( c ) A c on fi r m a ti o n d i a l og ( d ) A n o p t i on d i al o g

1 5. W h i ch o f th e f o l l ow i n g c l a s s e s a r e n o t i n t h e j ava. aw t p ackag e ? ( a) Fo nt ( b ) J Fr a m e ( c ) C o l or ( d ) C o m p o n e nt

1 6. To s e t a F l ow L ayo u t i n p an e l j p , you c a n u s e t h e m e t h o d . ( a) j p . s e tL ayo u t (n e w F l ow Layo u t ( F l ow L ayou t . c e nt e r ) ) ; ( b ) j p . s e tL ayo u t (n e w F l ow Layo u t ( )) ; ( c ) j p . s e tL ayo u t (n e w F l ow Layo u t ( F l ow L ayou t ) ) ; ( d ) j p . s e tL ayo u t (F l ow L ayou t ( ) );

1 7. T h e m e t h o d s e t s t h e b a ckg r ou n d c o l or t o ye l l ow i n J Fra m e f . ( a) s e t B ack g ro u n d ( C ol o r . Y E L L OW ) ( b ) s e t B ack g ro u n d ( C ol o r . ye l l ow ) ( c ) f . s e tB ack G r o u n d ( C ol o r . ye l l ow ) ( d ) f . s e tB ack g r ou n d ( C o l or . Y E L L OW )

1 8. W h i ch o f th e f o l l ow i n g s t a t e m e nt i s f al s e ? ( a) T h e p ai nt C o m p on e nt me th o d i s a u t om a t i c al l y i nvoke d by t h e J V M . Yo u s h o u l d n e ve r i nvoke i t d i r e c tl y. ( b ) W h e n e ve r a G U I c o m p o n e nt i s di s p l aye d , i t s G r ap h i c s o b j e c t i s a u t om a t i c al l y c r e at e d . ( c ) I nvok i n g r e p ai nt ( ) c a u s e s p ai nt C o m p on e nt to b e i nvo ke d by t h e J V M . ( d ) Yo u m ay c r e a te a G r a p h i c s o b j e c t u s i n g n e w G r a p h i c s ( ) .

1 9. D e f a u l t Li s tC e l l Re n de re r c a n d i s p l ay . ( a) b o t h s t r i n g an d i c on ( b ) a s t r i n g or an i c on ( c ) o n l y an i c on ( d ) o n l y a s t r i n g

2 0. To c r e at e an I n p u t S tr e a m t o r e a d f r o m a fi l e o n a We b s e r ve r , yo u u s e t h e m e t h o d i n t h e U RL c l as s . ( a) c o n n e c t S t re am ( ) ; ( b ) g e t I n p u t S tr e a m ( ); ( c ) o b ta i n I n p u t S t re am ( ) ; ( d ) o p e n S t r e am ( ) ;

D A D B B A A C C A B B C A B B D D B D

0 comments:

Post a Comment