Home » JAVA Programming » Java Basic » Question
  1. How constructor can be used for a servlet?
    1. Setup() method
    2. Initialization
    3. Constructor function
    4. Initialization and Constructor function
    5. None of these
Correct Option: D

We cannot declare constructors for interface in Java. This means we cannot enforce this requirement to any class which implements Servlet interface.
Also, Servlet requires ServletConfig object for initialization which is created by container.



Your comments will be displayed only after manual approval.