188
99.7k

180+ Enterprise Computing With JAVA Solved MCQs

These multiple-choice questions (MCQs) are designed to enhance your knowledge and understanding in the following areas: Master of Computer Applications (MCA) .

Chapters

Chapter: Unit 3
101.

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

A. javax.transaction.UserTransaction
B. javax.ejb.SessionSynchronization
C. javax.ejb.EJBContext
D. javax.transaction.TransactionContext
Answer» B. javax.ejb.SessionSynchronization
102.

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 ?

A. NoSuchEntityException
B. EJBException
C. RemoteException
D. ObjectNotFoundException
Answer» A. NoSuchEntityException
103.

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

A. XML
B. XSL
C. HTML
D. Java
Answer» A. XML
104.

EJB is a

A. Middleware
B. Scalable component architecture
C. Component architecture to integrate legacy systems
D. All of the above.
Answer» D. All of the above.
105.

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

A. Both (I) and (II) above
B. Both (II) and (III) above
C. Both (III) and (IV) above
D. Both (I) and (III) above.
Answer» D. Both (I) and (III) above.
106.

Which of the following is true for EJB?

A. EJB is server-side component architecture for distributed applications in Java
B. EJB facilitates scalable, secure and transaction-oriented applications
C. EJB supports portability and reusability
D. All of the above.
Answer» D. All of the above.
107.

Which of the following EJB type has no Remote interfaces?

A. Message-Driven Bean
B. BMP Entity Bean
C. CMP Entity Bean
D. none
Answer» A. Message-Driven Bean
108.

Which role in EJB architecture is responsible for EJB Server?

A. EJB Deployer
B. Application Assembler
C. Network Engineer
D. Server Provider
Answer» D. Server Provider
109.

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

A. Only (I) above
B. Only (II) above
C. Only (III) above
D. Both (I) and (II) above
Answer» C. Only (III) above
110.

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

A. Application Server
B. Web Server
C. Database Server
D. Fat Client
Answer» A. Application Server
111.

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

A. Only (I) above
B. Only (II) above
C. Only (III) above
D. Only (IV) above
Answer» B. Only (II) above
112.

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

A. Atomicity
B. Consistency
C. Isolation
D. Distributed
Answer» D. Distributed
113.

Which of the following is not true for servlet?

A. It is persistent
B. Platform independent
C. High performance
D. It is single threaded.
Answer» D. It is single threaded.
114.

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

A. <jsp:include>
B. <jsp:forward>
C. <jsp:redirect>
D. <jsp:useBean>
Answer» B. <jsp:forward>
115.

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

A. Hidden Form Field
B. URL Rewriting
C. Cookies
D. All of the above.
Answer» D. All of the above.
116.

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

A. Both (I) and (II) above
B. Both (II) and (III) above
C. Both (III) and (IV) above
D. Both (I) and (III) above.
Answer» D. Both (I) and (III) above.
117.

Which EJB usually represents persistent data?

A. Entity Bean
B. Stateless Session Bean
C. Stateful Session Bean
D. Message-Driven Bean
Answer» A. Entity Bean
118.

Which is least visibility scope for Java bean in JSP?

A. Page
B. Session
C. Request
D. Application
Answer» A. Page
119.

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

A. Only (I) above
B. Only (II) above
C. Both (I) and (II) above
D. Both (II) and (III) above
Answer» C. Both (I) and (II) above
120.

Which of the following is true for JNDI?

A. Database service
B. Naming and Directory Service
C. Network Service
D. Web Service
Answer» B. Naming and Directory Service
121.

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

A. getParameter
B. getParameterNames
C. getValues
D. putValues
Answer» A. getParameter
122.

Which of the following is true for CORBA?

A. Protocol for distributed computing
B. Database specification
C. Specification for distributed objects
D. Both (c) and (d) above.
Answer» D. Both (c) and (d) above.
123.

Which EJB uses EJB-QL for query operations?

A. BMP Entity Bean
B. CMP Entity Bean
C. Session Bean
D. Message-Driven Bean
Answer» B. CMP Entity Bean
124.

Which of the following is true for Java Bean?

A. It can not be a GUI component
B. It never implements serializable interface
C. It has zero-argument constructor
D. It is a distributed component
Answer» C. It has zero-argument constructor
125.

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

A. Locates a bean instance
B. Stores object reference of the bean in a variable
C. Creates an instance if fails to locate the bean instance
D. All the above.
Answer» D. All the above.
126.

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

A. Both (I) and (II) above
B. Both (II) and (III) above
C. Both (I) and (III) above
D. Both (III) and (IV) above.
Answer» D. Both (III) and (IV) above.
127.

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

A. Page
B. Session
C. Request
D. Global.
Answer» D. Global.
128.

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.

A. 1 and 2
B. 2 and 3
C. 3 and 4
D. 4 and 1
Answer» A. 1 and 2
129.

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.

A. 1 and 3
B. 2 and 5
C. 3 and 5
D. 4 and 2
Answer» C. 3 and 5
130.

Which statement about session beans is true?

A. In both stateless and statefull session classes, the bean provider must write the method public void remove()
B. The method << remove >> in the component interface can be accessed only by the remote clients
C. The bean’s handle must be provided by the client, in order to ask the EJBHome for removing a session bean
D. None of the above
Answer» C. The bean’s handle must be provided by the client, in order to ask the EJBHome for removing a session bean
131.

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

A. ejbPassivate
B. business methods
C. setSessionContext
D. newInstance
Answer» B. business methods
132.

Which is the method available in SessionContext interface?

A. afterBegin()
B. getRollbackOnly()
C. setSessionCotext()
D. getUserTransaction()
Answer» C. setSessionCotext()
133.

Which statements about a session bean class are true?

A. It is a final class
B. Overloaded constructors are supported
C. Their business methods can be 'private'
D. The ejbCreate() method must not be a final method
Answer» D. The ejbCreate() method must not be a final method
134.

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?

A. Required
B. RequiresNew
C. Never
D. Mandatory
Answer» C. Never
135.

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

A. 1,4,3
B. 4,2,6
C. 1,4,6
D. 2,5,6
Answer» C. 1,4,6
136.

EJB system’s performance tuning is the responsibility of

A. Bean Provider
B. EJB Deployer
C. Application Assembler
D. Tool Vendor
Answer» B. EJB Deployer
137.

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

A. TX_SUPPORTS
B. TX_MANDATORY
C. TX_REQUIRED and TX_REQUIRES_NEW
D. Either A or B
Answer» C. TX_REQUIRED and TX_REQUIRES_NEW
138.

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

A. True
B. False
C. none
D. all
Answer» A. True
139.

Abbreviate the term JMS?

A. Java Message Service
B. Java Monitor Service
C. Java Message Session
D. Java Monitor Session
Answer» A. Java Message Service
140.

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

A. True
B. False
C. none
D. all
Answer» B. False
141.

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.

A. True
B. False
C. none
D. all
Answer» A. True
142.

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

A. Bean-managed transactions
B. Container-managed transactions
C. Both A & B
D. None of the above
Answer» A. Bean-managed transactions
143.

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

A. Transaction support
B. Persistence support
C. Naming support
D. All mentioned above
Answer» D. All mentioned above
144.

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

A. Transaction support
B. Persistence support
C. Naming support
D. All mentioned above
Answer» C. Naming support
145.

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

A. Stateful Session Bean
B. Stateless Session Bean
C. Singleton Session Bean
D. None of the above
Answer» C. Singleton Session Bean
146.

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

A. True
B. False
C. none
D. all
Answer» A. True
147.

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

A. True
B. False
C. none
D. all
Answer» B. False
Chapter: Unit 4
148.

Which statement characterizes stateless session beans?

A. They allow the PostConstruct, PreDestroy, and PrePassivate life-cycle callbacks.
B. They require home interfaces.
C. When a client looks up a stateful session bean in the JNDI, the same bean is returned every time.
D. They are asynchronous message consumers.
Answer» A. They allow the PostConstruct, PreDestroy, and PrePassivate life-cycle callbacks.
149.

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?

A. getEJBHome
B. getCallerPrincipal (*)
C. isCallerInRole
D. getEJBLocalHome
Answer» B. getCallerPrincipal (*)
150.

Which statement about entities is correct?

A. Entities must be annotated with the @Entity annotation.
B. Entities can be final classes.
C. Entities can have a single no-arg constructor with protected visibility.
D. Instance variables of an entity can have private, protected, public, or package visibility.
Answer» C. Entities can have a single no-arg constructor with protected visibility.

Done Studing? Take A Test.

Great job completing your study session! Now it's time to put your knowledge to the test. Challenge yourself, see how much you've learned, and identify areas for improvement. Don’t worry, this is all part of the journey to mastery. Ready for the next step? Take a quiz to solidify what you've just studied.