Learn J2EE MCQs

Prepare J2EE MCQs (Multiple choice Questions) for exam and job interviews.

Which of these is used for asynchronous messaging in J2EE?

1) JMS

2) JNDI

3) RMI

4) JTA

Answer : JMS

What does the `service()` method in a servlet do?

1) Handles client requests

2) Initializes the servlet

3) Handles exceptions

4) Terminates the servlet

Answer : Handles client requests

Which J2EE technology is used for managing user transactions?

1) JTA

2) JMS

3) JMX

4) JNDI

Answer : JTA

Which element is used to configure a servlet in web.xml?

1) <servlet>

2) <bean>

3) <context>

4) <filter>

Answer : <servlet>

What is `Struts` in J2EE?

1) A framework for building web applications

2) A messaging service

3) A database management system

4) An ORM tool

Answer : A framework for building web applications

Which of the following is a benefit of using J2EE?

1) Scalability

2) Limited portability

3) Hard to integrate

4) No transaction management

Answer : Scalability

What is the main purpose of the `web.xml` file in J2EE?

1) Configuration of servlets and filters

2) Database connections

3) Managing transactions

4) Handling exceptions

Answer : Configuration of servlets and filters

Which technology is used for handling HTTP requests in J2EE?

1) Servlets

2) Sockets

3) Threads

4) AWT

Answer : Servlets

Which of the following provides an API for asynchronous messaging in J2EE?

1) JMS

2) JTA

3) JDBC

4) JNDI

Answer : JMS

Which of the following is a container used in J2EE?

1) EJB container

2) JDBC driver

3) JMX server

4) JavaBeans

Answer : EJB container