Learn J2EE MCQs

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

What does `RMI` stand for in J2EE?

1) Remote Method Invocation

2) Remote Message Invocation

3) Request Management Interface

4) Resource Management Invocation

Answer : Remote Method Invocation

Which J2EE component is responsible for handling HTTP requests and responses?

1) Servlet

2) EJB

3) JMS

4) JNDI

Answer : Servlet

What does the `@WebServlet` annotation in J2EE do?

1) Registers a servlet

2) Registers a filter

3) Registers an EJB

4) Registers a JSP

Answer : Registers a servlet

Which method is used to invalidate a session in J2EE?

1) session.invalidate()

2) session.destroy()

3) session.end()

4) session.remove()

Answer : session.invalidate()

Which of the following is NOT a valid HTTP method?

1) GET

2) POST

3) FETCH

4) DELETE

Answer : FETCH

What is the default scope of an HTTP session in J2EE?

1) Application

2) Session

3) Request

4) Cookie

Answer : Session

Which J2EE technology provides a distributed object architecture?

1) JNDI

2) JTA

3) EJB

4) RMI

Answer : EJB

Which is a valid JSP directive?

1) <@page>

2) <%page%>

3) <%page>

4) <%@page%>

Answer : <%@page%>

What is the purpose of `JNDI` in J2EE?

1) Database connection

2) Directory services

3) Asynchronous messaging

4) Transaction management

Answer : Directory services

What is the use of `@WebListener` annotation in J2EE?

1) Defines a servlet

2) Registers a listener

3) Manages a session

4) Handles HTTP methods

Answer : Registers a listener