1. What is the purpose of the `@WebServlet` annotation in a Java web application? A. To declare a servlet and its mapping B. To define JavaBean properties C. To execute SQL queries D. To create JavaBeans Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
2. In a Java web application, what is the role of the `ServletContext` object? A. It creates JavaBeans B. It executes SQL queries C. It defines JavaBean properties D. It provides access to application-wide information and resources Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
3. What is the primary purpose of the `@PostConstruct` annotation in Java EE applications? A. To define JavaBean properties B. To execute SQL queries C. To specify a method to be executed after an instance is created and its dependencies are injected D. To create JavaBeans Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
4. In Java EE applications, what is the purpose of the `@Resource` annotation? A. To execute SQL queries B. To specify a resource to be injected into a component C. To create JavaBeans D. None of These Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
5. What is the `web.xml` deployment descriptor used for in a Java web application? A. To create JavaBeans B. To execute SQL queries C. To configure web application settings and servlet mappings D. To define JavaBean properties Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
6. In a Java web application, what is the purpose of the `@WebListener` annotation? A. To define JavaBean properties B. To execute SQL queries C. To create JavaBeans D. To declare a listener class for various events in the web application Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
7. What is the role of the `ServletContextListener` interface in Java web applications? A. To listen for context initialization and destruction events B. To define JavaBean properties C. To execute SQL queries D. To create JavaBeans Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
8. Which annotation is used to specify that a method should be invoked after a session is invalidated in a Java web application? A. `@WebListener` B. `@Resource` C. `@PostConstruct` D. `@PreDestroy` Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
9. What is the purpose of the `@PreDestroy` annotation in Java EE applications? A. To define JavaBean properties B. To execute SQL queries C. To specify a method to be executed before an instance is removed by the container D. To create JavaBeans Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
10. In a Java EE application, what is the role of the `@EJB` annotation? A. To execute SQL queries B. To inject an EJB (Enterprise JavaBean) component C. To create JavaBeans D. None of These Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board