Learn J2EE MCQs
Prepare J2EE MCQs (Multiple choice Questions) for exam and job interviews.
Which tag is used for configuring security constraints in web.xml?
1) <security-constraint>
2) <filter>
3) <listener>
4) <servlet>
Answer : <security-constraint>
Which method in a J2EE servlet handles POST requests?
1) doPost()
2) doGet()
3) doPut()
4) doUpdate()
Answer : doPost()
What is the purpose of `Session` management in J2EE?
1) Maintain user data across requests
2) Handle HTTP requests
3) Manage security
4) Process transactions
Answer : Maintain user data across requests
What does `EAR` stand for in J2EE?
1) Enterprise Archive
2) Enterprise Access Resource
3) Enterprise Asynchronous Request
4) Enterprise Application Runner
Answer : Enterprise Archive
Which of the following is used for rendering dynamic content in J2EE?
1) JSP
2) Servlet
3) RMI
4) JDBC
Answer : JSP
What is the main role of `JNDI` in J2EE?
1) Naming and directory lookup
2) Managing sessions
3) Handling exceptions
4) Running background tasks
Answer : Naming and directory lookup
Which J2EE component is used to manage database transactions?
1) JDBC
2) JTA
3) EJB
4) Servlet
Answer : JTA
Which tag in web.xml is used to map servlets?
1) <servlet-mapping>
2) <servlet>
3) <filter>
4) <listener>
Answer : <servlet-mapping>
Which of these is a stateful component in J2EE?
1) Stateful Session Bean
2) Entity Bean
3) Servlet
4) Stateless Session Bean
Answer : Stateful Session Bean
What does the term `hot deployment` refer to in J2EE?
1) Deploying applications without restarting the server
2) Automatically stopping the server
3) Fast compilation
4) Handling concurrent requests
Answer : Deploying applications without restarting the server