Number of ServletContext object present for an application is __________

  1. 2

  2. 1

  3. Not Fixed

  4. 3


Correct Option: B

AI Explanation

To answer this question, we need to understand the concept of the ServletContext object and its relationship to a web application.

The ServletContext object represents a single web application running on a web server. It provides a way for servlets to communicate with the web container and access application-wide resources.

In a web application, there is only one ServletContext object that is shared among all the servlets and other components within that application. This means that all the servlets within the same web application can access and manipulate the same ServletContext object.

Therefore, the correct answer is:

B. 1 - There is only one ServletContext object present for an application.

Find more quizzes: