Quiznetik

Enterprise Computing With JAVA | Set 2

1. Which interface should be implemented by a stateful session bean if it needs to synchronize its conversational state with the transactional context?

Correct : B. javax.ejb.SessionSynchronization

2. Which of the following exceptions is thrown by the ejbLoad() method of an entity bean when the database row to be loaded is not found ?

Correct : A. NoSuchEntityException

3. Which of the following is the format for EJB deployment descriptor files?

Correct : A. XML

4. EJB is a

Correct : D. All of the above.

5. Which of the following EJB has no state? i. Message-Driven Bean. ii. BMP Entity Bean. iii. Stateless Session Bean. iv. Stateful Session Bean.

Correct : D. Both (I) and (III) above.

6. Which of the following is true for EJB?

Correct : D. All of the above.

7. Which of the following EJB type has no Remote interfaces?

Correct : A. Message-Driven Bean

8. Which role in EJB architecture is responsible for EJB Server?

Correct : D. Server Provider

9. Which of the EJB has a passive state in its life cycle? I. Stateless Session Bean. II. Message-Driven Bean. III. BMP Entity Bean.

Correct : C. Only (III) above

10. Which part of multi-tier enterprise application contains EJB component?

Correct : A. Application Server

11. Which of the following distributed object technology is/are not included in Java? I. CORBA. II. DCOM. III. RMI. IV. EJB.

Correct : B. Only (II) above

12. Which of the following is not a property of EJB transaction?

Correct : D. Distributed

13. Which of the following is not true for servlet?

Correct : D. It is single threaded.

14. Which JSP tag is used to transfer processing to another JSP page?

Correct : B. <jsp:forward>

15. Which of the following is an approach for state maintenance in Web applications?

Correct : D. All of the above.

16. Which of the following is not a container for EJB? I. Internet Information Server. II. Java System Application Server. III. Tomcat. IV. WebLogic.

Correct : D. Both (I) and (III) above.

17. Which EJB usually represents persistent data?

Correct : A. Entity Bean

18. Which is least visibility scope for Java bean in JSP?

Correct : A. Page

19. Which of the following is/are true for JSP technology? I. It is persistent. II. Platform independent. III. Browser executes the code.

Correct : C. Both (I) and (II) above

20. Which of the following is true for JNDI?

Correct : B. Naming and Directory Service

21. Which method of the request object is used to extract values of the input fields in a form when it is submitted?

Correct : A. getParameter

22. Which of the following is true for CORBA?

Correct : D. Both (c) and (d) above.

23. Which EJB uses EJB-QL for query operations?

Correct : B. CMP Entity Bean

24. Which of the following is true for Java Bean?

Correct : C. It has zero-argument constructor

25. Which of the following is not true for <jsp:useBean> tag in JSP page?

Correct : D. All the above.

26. Which of the following is not an implicit object in JSP? I. Request. II. Session. III. Vector. IV. In.

Correct : D. Both (III) and (IV) above.

27. Which is not a valid scope for Java bean in JSP?

Correct : D. Global.

28. Which two of the following is responsible to creates ejb-jar files? 1. The bean provider. 2. The application assembler. 3. The deployer. 4. The system administrator.

Correct : A. 1 and 2

29. Which two of the following must be included in every ejb-jar file? 1. Stubs for the EJBHome and EJBObject interface. 2. The JAR Manifest file. 3. A deployment descriptor. 4. The JNDI context. 5. The EJB's home interface.

Correct : C. 3 and 5

30. Which statement about session beans is true?

Correct : C. The bean’s handle must be provided by the client, in order to ask the EJBHome for removing a session bean

31. Which of the following can be directly invoked by the client?

Correct : B. business methods

32. Which is the method available in SessionContext interface?

Correct : C. setSessionCotext()

33. Which statements about a session bean class are true?

Correct : D. The ejbCreate() method must not be a final method

34. Upon invoking getRollbackOnly() method by a business method in an entity bean, which transaction attribute settings will lead the ejb container to throw an exception?

Correct : C. Never

35. When a session bean has container-managed demarcation value of 'Supports', which three methods run in an unspecified transaction context? 1. ejbActivate 2. getRollbackOnly 3. getUserTransaction 4. ejbRemove 5. afterBegin 6. afterCompletion

Correct : C. 1,4,6

36. EJB system’s performance tuning is the responsibility of

Correct : B. EJB Deployer

37. The EJB Transaction Attribute that ensures the method call that always takes place in a transaction, either client started or container started’ are

Correct : C. TX_REQUIRED and TX_REQUIRES_NEW

38. JMS is mainly used to send and receive message from one application to another.

Correct : A. True

39. Abbreviate the term JMS?

Correct : A. Java Message Service

40. A message driven bean is like statefull session bean that encapsulates the business logic and doesn't maintain state.

Correct : B. False

41. EJB QL is a Query Language provided for navigation across a network of enterprise beans and dependent objects defined by means of container managed persistence.

Correct : A. True

42. Which case of a session bean obtains the UserTransaction object via the EJBContext using the getUserTransaction() method in EJB transaction management?

Correct : A. Bean-managed transactions

43. Which services are provided to EJB components by the EJB container?

Correct : D. All mentioned above

44. Which EJB container must provide an implementation of Java Naming and Directory Interface (JNDI) API to provide naming services for EJB clients and components?

Correct : C. Naming support

45. Which session bean maintain their state between client invocations but are not required to maintain their state across server crashes or shutdowns?

Correct : C. Singleton Session Bean

46. EJB is a specification for J2EE server, not a product; Java beans may be a graphical component in IDE.

Correct : A. True

47. A session bean represents a multiple clients inside the Application Server.

Correct : B. False

48. Which statement characterizes stateless session beans?

Correct : A. They allow the PostConstruct, PreDestroy, and PrePassivate life-cycle callbacks.

49. A message-driven bean can have an instance of a MessageDrivenContext injected. Which method can be successfully invoked on this interface from a message-driven bean?

Correct : B. getCallerPrincipal (*)

50. Which statement about entities is correct?

Correct : C. Entities can have a single no-arg constructor with protected visibility.

51. Which statement is correct about the EntityManager API?

Correct : C. The getReference method can throw an EntityNotFoundException.

52. Which statement about JTA and resource-local entity managers is correct?

Correct : C. The EntityTransaction interface must be used when using a resource-local entity manager. (*)

53. Which of the following is not a container for EJB? I. Internet Information Server. II. Java System Application Server. III. Tomcat. IV. WebLogic.

Correct : D. Both (I) and (III) above.

54. Which of the following is/are true for JSP technology? I. It is persistent. II. Platform independent. III. Browser executes the code.

Correct : C. Both (I) and (II) above

55. Which method of the request object is used to extract values of the input fields in a form when it is submitted?

Correct : A. getParameter

56. Which method of the servlet is/are called several times in its life?

Correct : B. doPost()

57. Which object is used to forward the request processing from one servlet to another?

Correct : C. RequestDispatcher

58. Which of the following allows substitution of code to occur at the translation time in a JSP page?

Correct : B. <@ include> directive

59. Which of the following property of Java Bean represents a single value?

Correct : D. Both (a) and (b) above

60. Which of the following is used to redirect the response from a servlet to a JSP page?

Correct : A. response.sendRedirect()

61. Which of the following is not true for <jsp:useBean> tag in JSP page?

Correct : D. Does not execute the body tag if any

62. Which of the following is not an implicit object in JSP? I. Request. II. Session. III. Vector. IV. In.

Correct : D. Both (III) and (IV) above.

63. Which statement is true for the Class java.util.HashSet?

Correct : B. The elements in the collection are unique.

64. Which cannot directly cause a thread to stop executing?

Correct : C. Calling the notify method on an object.

65. Which of the following statement is true?

Correct : B. Enclosing scope.

66. Which of the following below are abilities of Reflection API in Java?

Correct : D. Determination of the class of an object

67. Which of the methods should be implemented if any class implements the Runnable interface?

Correct : B. run()

68. Business delegate pattern

Correct : D. All of the above

69. Which of the following is not a life-cycle method for a Stateful Session Bean?

Correct : D. Pre Construction

70. Which of the following is true?

Correct : A. Preserving of any state across method calls does not performed by Stateless session beans

71. Stateful Session beans contain

Correct : D. All of the above

72. Which of the following regarding business methods in a bean class is incorrect?

Correct : B. For Java RMI API, the argument and return types must always be legal types

73. Choose the incorrect statement from the following about Home methods in a bean class for CMP (Container Managed Persistence).

Correct : A. The throws clause of the method may include the java.rmi.RemoteException.

74. Given the following code in a stateful session bean business method; try { Socket skt = new Socket(x,y); } catch (Exception ex) { ex.printStackTrace(); } Assuming that x and y are the port and IP addresses respectively of a running service, which is running on the same server, which of the following is correct?

Correct : D. Indeterminate. The code is not guaranteed to be ported to all EJB 2.0 containers, though it may deploy.

75. Which of the following is true about EJB transactions?

Correct : D. Bean-managed transaction demarcation must not be used in Entity beans

76. Which of the following are guaranteed capabilities of EJB 2.0?

Correct : C. Both A and B

77. From the following APIs, which API does NOT guarantee to be supported by EJB 2.0 containers?

Correct : C. JXTA

78. Which component does the Entity bean represent the persistent data stored in the database?

Correct : A. Server-side component

79. EJB is like COM, Abbreviate the term COM?

Correct : A. Component Object Model

80. JMS is also known as a messaging service.

Correct : A. True

81. The life cycle of session bean is not maintained by the application server (EJB Container).

Correct : B. False

82. What represents a persistent global data from the database?

Correct : A. Entity Bean

83. Which component does the Entity bean represents the persistent data stored in the database?

Correct : A. Server-side component

84. In EJB, middleware services are provided by EJB Container automatically.

Correct : A. True

85. Which middleware services are provided by EJB?

Correct : C. Both A & B

86. Which server-side component is required to be deployed on the server?

Correct : A. EJB