Learn J2EE MCQs

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

What is the role of a `Session Bean` in J2EE?

1) Handles business logic

2) Manages transactions

3) Handles messaging

4) Provides security

Answer : Handles business logic

Which of the following is a deployment descriptor in J2EE?

1) web.xml

2) web.txt

3) servlet.config

4) app.manifest

Answer : web.xml

Which of these provides lifecycle management for enterprise beans?

1) EJB container

2) JNDI

3) JDBC

4) Servlet container

Answer : EJB container

Which of the following is a stateful component in J2EE?

1) Stateful Session Bean

2) Message-Driven Bean

3) Stateless Session Bean

4) Servlet

Answer : Stateful Session Bean

What is the purpose of the `init()` method in a servlet?

1) To initialize the servlet

2) To handle requests

3) To create a response

4) To destroy the servlet

Answer : To initialize the servlet

Which of the following is used for managing distributed transactions in J2EE?

1) JTA

2) JMS

3) JDBC

4) JNDI

Answer : JTA

Which of the following is used for J2EE resource management?

1) JNDI

2) JTA

3) JMX

4) JSP

Answer : JNDI

Which tag is used to define a filter in J2EE?

1) <filter>

2) <servlet>

3) <context>

4) <listener>

Answer : <filter>

Which J2EE component is responsible for handling business logic?

1) EJB

2) JSP

3) Servlet

4) JDBC

Answer : EJB

Which of the following is not a J2EE web technology?

1) JDBC

2) JSP

3) Servlets

4) HTML

Answer : JDBC