Why there is no Constructor in Servlet

  • Every java class will have aleast one constructor and servlets are no exception to this.
  • But while using servlets ,we never instantiate the servlet rather the container does it for us by using the newInstance() defined in the Class class;  which in turn uses the empty(Default) constructor to create a new instance of the servlet.
  • If we define parameterised constructor in the serlet ,then container will fail in instantiating the servlet.
  • The rest is left for you to decide whether a servlets need a user defined constructor or not.