This action might not be possible to undo. Are you sure you want to continue?
" When a JSP page is compiled, what is it turned into? Answer #B$% Compiled JSP pages are turned into Servlets. See JSP Architecture &or more in&ormation on this translation phase. '. Which o& the &ollowing is not a standard method called as part o& the JSP li&e c(cle? A. )sp*nit#$
D. )spDestro(#$ Blan! "
Which o& the &ollowing is not a standard method called as part o& the JSP li&e c(cle? Answer #B$% ,he standard service method &or JSP has an + in its name. See JSP Architecture.
-. *& (ou want to override a JSP &ile.s initiali/ation method, within what t(pe o& tags must (ou declare the method? A. 01 12
B. 031 32
C. 03 32
D. 034 32 Blan! " *& (ou want to override a JSP &ile.s initiali/ation method, within what t(pe o& tags must (ou declare the method? Answer #D$% Declarations are placed within a set o& 034 32 tags. See Declarations.
5. Which o& the &ollowing can not 6e used as the scope when using a JavaBean with JSP?
page Blan! " Which o& the &ollowing can not 6e used as the scope when using a JavaBean with JSP? Answer #D$% 9esponse is not a valid o6)ect scope &or JavaBeans #or an(thing else$.. . re7uest D. response 8. See :6)ect Scopes. session C. . response. A.he implicit JSP o6)ects li!e re7uest.A. and out are onl( visi6le in the +)spService#$ method. application B. .
rue B. 031 page is.send9edirect#$? Answer #B$% When (ou &orward a re7uest. response. 9edirections are done on the client and thus don.he implicit JSP o6)ects li!e re7uest. &orward e@ecutes on the client while send9edirect#$ e@ecutes on the server. the &orwarding is done within the server. See JSP *mplicit :6)ects.. >.hreadSa&eBC&alseC 32 B. A. See S(nchroni/ation *ssues. the implicit JSP arguments are onl( visi6le in the )spService#$ method. D. What is the !e( di&&erence 6etween using a 0)sp%&orward2 and ?ttpServlet9esponse. Which o& the &ollowing statements ma!es (our compiled JSP page implement the Single. See *ncluding 9e7uests.he two methods per&orm identicall(. which can the end user see? A. it will implement the inter&ace. C.send9edirect#$? A.hread odel inter&ace? Answer #A$% *& (ou &lag the JSP page as not 6eing thread sa&e. and limited in scope to where (ou can &orward.hreadSa&eBCtrueC 32 Blan! " Which o& the &ollowing statements ma!es (our compiled JSP page implement the Single.t have these limitations. Answer% #A$ =nless passed in as arguments to other methods. 031 page is. <alse Blan! " . . Blan! " What is the !e( di&&erence 6etween using a 0)sp%&orward2 and ?ttpServlet9esponse. :& the &ollowing &our valid comment st(les that can 6e used within JSP pages. and out are onl( visi6le in the +)spService#$ method. B. &orward e@ecutes on the server while send9edirect#$ e@ecutes on the client. .hread odel inter&ace? A.
set to #??? in the &ollowing code$ &or automatic initiali/ation? 0)sp%useBean idBC&BeanC classBCgovi. N B. *n a nonEJQD* environment.<ormBeanC scopeBCre7uestCI2 0)sp%setPropert( nameBC&BeanC propert(BC???C I2 0)sp%&orward pageBCIservletIJSP'ServletC I2 A. What does JDBC stand &or? EEB A. 1. Pass the class name to the &orQame method o& Class D. .s constructor C. JDBC is not an acron(m . Call the driver. Java Data6ase Connectivit( B. Con&igure the list o& drivers in the )d6c.driver s(stem propert( B. See =sing JavaBean Components. what must the propert( 6e set to #??? in the &ollowing code$ &or automatic initiali/ation? Answer #A$% . =se JQD* to locate the Driver -. through which class does one ac7uire a connection to a speci&ic data source?EEB A. 1 D. all C. Which o& the &ollowing wa(s will not load a JDBC driver?EED A. B Blan! " When using a JavaBean to get all the parameters &rom a &orm.he N character is used &or this..
Connection D. Pass the class name as a String to the &orQame method o& Class. Driver anager C. Driver B. Speci&( the driver or set o& drivers to use 6( setting the )d6c. . Data6ase etaData 8. c. DataSource O. Conte@t A. an*nteger$S. Which wa( o& loading the data6ase driver can create two instances o& the class?EC A. 1. *n a JQD* environment. *& (ou add an *nteger to a Properties o6)ect via the put method o& ?ashta6le as 6oth the !e( and value Rprops. Driver anager C. through which class does one ac7uire a connection to a speci&ic data source?EE8 A. Create an instance o& the class.t compile B. Connection D.he code won.drivers s(stem propert(. B. .put#an*nteger. what happens when (ou tr( to store the Properties set to a <ile:utputStream?EEC A.Driver B. Data6ase etaData 8.
Compara6le C.. including the de&aults?EEEB A. passing in the source Properties o6)ect to its constructor. Dictionar( C. ?ashta6le . :6)ect B. Seriali/a6le . Which inter&ace does ?ashta6le not implement?EEB A. Create a new . Which o& the &ollowing would sort all the elements in a Properties set. Call the toArra( method o& Properties and then call Arra(s.sort on the result. D.ree ap. C. A ClassCast8@ception is thrown 6ecause the !e( is not a String D. A ClassCast8@ception is thrown 6ecause the value is not a String -. ap D.ree ap and to the map each !e( reported 6( propert(Qames and its associated value. Call the sort method o& Collections to sort the whole ap #Properties o6)ect$.he toString method o& *nteger is called to write 6oth the !e( and value as a String. :& which o& the &ollowing is Properties not a descendent class?EEC A. A. Clonea6le B.. Create a new . C. B. ?ash ap D.
d C. C. What options are availa6le &or wor!ing with propert( &iles that re7uire character encoding in other than the de&ault character set?EEED A.est1 L pu6lic static int a B 1F private static int 6 B 'F pu6lic int c B -F private int d B 5F pu6lic static class *nner L int e B . *n the &ollowing class de&inition. D. Pass the encoding name to the load method o& Properties. B.O. d B. =se the native'ascii tool to convert propert( &iles to other character encoding. Pass the encoding name to the constructor call o& the Properties o6)ect. Pass the encoding name to the *nputStream9eader constructor and then pass that 9eader on to the load method o& Properties.t 6e accessed here? M M M A. c. 1G. 6. which varia6les are inaccessi6le within the method o& the inner class?EEB class . .F pu6lic void a ethod#int &$ L int g B >F II What can. c.
& D. 6. d .F pu6lic void a ethod#int &$ L int g B >F II What can. d. *n the &ollowing class de&inition.est' L pu6lic static int a B 1F private static int 6 B 'F pu6lic int c B -F private int d B 5F pu6lic class *nner L int e B . c. which varia6les are inaccessi6le within the method o& the inner class? EEE8 class . d B. c.t 6e accessed here? M M M A.6. c. Qone o& them 11.
& D. 6.C. c. d.L pu6lic static int a B 1F private static int 6 B 'F pu6lic int c B -F private int d B 5F pu6lic void a ethod#int e$ L int & B . & 8. which varia6les are inaccessi6le within the method o& the inner class? EEEB class . c. Qone o& them 1'. d. d .est.F class *nner L int g B >F pu6lic void another ethod#int h$ L II What can?t 6e accessed here? M M M M A. c. *n the &ollowing class de&inition.
&.s wrong with the &ollowing code? EEED class . & D. e. c.est5 L pu6lic static void main#String argsRS$ L ouseJistener listener B new ouseAdapter#$ L static int countF pu6lic void mouse8ntered# ouse8vent e$ L process*t#e$F M private void process*t# ouse8vent &$ L S(stem.out. e. Qone o& them. g 8. 1-. .println#CCount% C K KKcount$F M MF M M A.out.B.println#CHot% C K &$F S(stem. d. e. & C. What.
Qothing is wrong.8. 1. 1.Anon(mous inner classes can onl( implement inter&aces.t have static declarations. 15. .G B.1 C. Where were inner classes introduced into the Java programming language s(nta@?EEB A. 1.he code compiles &ine. B. *nner classes can. 8. .' D. 1. *nner classes can. D.t implemented. All the methods o& ouseJistener aren. C.t have support methods.
s appearance and 6ehavior. Declare the instance varia6le private and let the BeanBo@ de&ine get and set methods &or the varia6le. . 1>. *ntrospection D. C.5 1. Drop the Bean into the BeanBo@ propert( sheet.. ?ow a JavaBean is compiled and dropped into the BeanBo@ #or other tool$. ethod customi/ation C. 1. B. . D. Which mechanism does the tool use? EEEC A. B. C. A JavaBean.1. Persistence B. Properties control what aspects o& a JavaBean? EEEB A.he communication 6etween JavaBeans.he tools (ou can use to customi/e a JavaBean. An application 6uilder tool can anal(/e how JavaBeans wor!. D. What do (ou have to do to ma!e an instance varia6le into a JavaBean propert(? EEEB A. De&ine a get method and a set method &or the varia6le. '. 8vent delegation -. Declare the instance varia6le pu6lic and static. .
s Tit. and Properties windows. Can 6e reused more rapidl( than widgets. D. ?owever. JavaBean methods are all EEED A. . . A. C. .oolBo@. 8vents B.he BeanBo@ is a JavaBean testing tool that comes with the Bean Developer. Can 6e run 6( more tools on more plat&orms than widgets. 9eceiver Bean C.. De&ine a designEtime inter&ace that tools can 7uer(.a!e up less storage space that widgets. A source Bean is a JavaBean that &ires an event. Properties C. . BeanBo@. 8nterprise JavaBean D. 8vent?andler Bean >. while the Bean that receives the event is called a EEEA A.5. Jistener Bean B. JavaBeans and widgets are 6oth considered to 6e reusa6le so&tware components. JavaBeans di&&er &rom widgets 6ecause Beans EEEB A. .he BeanBo@ has the &ollowing windows% EEEA A. *dentical to methods o& other Java classes . B. 8vent listeners D.
Writing a special adapter class. such as action events. . C. Add new properties to a Bean.B. Uou use the Propert( sheet in the BeanBo@ tool to EEEC A. =sing the BeanBo@ 8dit E2 8vents menu and resulting dialog 6o@ to hoo! up one Bean to another.s propert(. . C. D. D. 1G. a( 6e inherited 6( the Bean &rom its superclass. Delete a Bean. B. BeanBo@. ?aving the BeanBo@ generate the special adapter class. O. BeanBo@. .oolBo@ windows. Are de&ined 6( the Bean itsel&. and Harage windows. D. . B. An( o& the a6ove choices. Change the value o& a Bean.he properties o& a Bean EEED A. C.oolBo@. C. Properties and .oolBo@. All o& the a6ove. JavaBeans communicate with each other using events. B. and WindowsOD windows.s propert(. Uou esta6lish the connection 6etween Beans 6(% EEED A. D.
C. B. Compile the Bean. (ou can test it in the BeanBo@. Such invisi6le Beans EEE8 A. 8.Are analogous to instance varia6les. What do (ou have to do to 6e a6le to test the Bean in the BeanBo@? EEE8 A. D. 1-. 8. Can 6e saved and retrieved at a later time. ?as a corresponding get method and set method. Some JavaBeans are not meant to 6e visi6le and are re&erred to as invisi6le Beans. Are a6le to &ire events and save persistent state. Qone o& the a6ove. B. B. 1'. Qone o& the a6ove. All o& the a6ove. Are invisi6le in 6uilder tools. C. 11. *s declared as a private t(pe. A propert( de&ined in a JavaBean t(picall( EEED A. A and B onl(. D. All o& the a6ove. D. . ?ave no H=* representation. When (ou write the code &or a new JavaBean. 8. All o& the a6ove.
&orm the method name as &ollows% EEEC A. . An indicator that this is a JavaBean. 1>. A mani&est &ile &or a JavaBean contains the &ollowing in&ormation% EEED A. B. =se an( name (ou want &or the get method. Comple@ properties and 8ventEhandling properties .s class &ile. D.. =se onl( the propert( name &or the get method. and C. All o& the a6ove. D. B. When (ou write a get method &or a JavaBean propert(. A and B.Create a mani&est &ile &or the Bean. Joad the JA9 &ile into the BeanBo@ using the JoadJar menu option. 15. D. or place the JA9 &ile in the de&ault director( &rom which the BeanBo@ initiali/es and loads its Beans. C. A. C. C. 8. Qone o& the a6ove. A list o& the properties declared 6( the JavaBean. B. with the &irst letter o& the propert( name capitali/ed. 1. Which !inds o& properties can a Bean contain? EEEB A. 8. =se get &ollowed 6( the propert( name.he name o& the JavaBean. Create an e@ecuta6le JA9 &ile &or the Bean class and mani&est &ile.
D onl( H. Bound properties appear in the BeanBo@ with what !ind o& event in the 8dit E2 8vents menu? EEEB A. All o& the a6ove 1A. Simple properties. A JavaBean that de&ines 6ound properties t(picall( calls what methods so that other Beans can 6e noti&ied o& changes to the 6ound propert(? EEE8 A.he addActionJistener method so a Bean can register an interest in noti&ication o& changes to the propert(. B. . Constrained properties are EEEB . mouse moved event 1O. . .he addPropert(ChangeJistener method so a Bean can register an interest in noti&ication o& changes to the propert(. Constrained properties. All o& the a6ove 1D. actionPer&ormed event B. Bound properties C. .he &irePropert(Change method to send propert( change noti&ication to interested Beans. mouse pressed event D. propert(Change event C.he reportChange method to send propert( change noti&ication to interested Beans.B. C. A and C <. D. 8.
*dentical to 6ound properties e@cept that the( are onl( used on certain plat&orms.A. . D. *dentical to 6ound properties e@cept that the( are inde@ed. Qone o& the a6ove. C. B. *dentical to 6ound properties e@cept that the listener Bean can veto the propert( change.
This action might not be possible to undo. Are you sure you want to continue?