Points To Remember Servlet is a java class that implements javax.servlet.Servlet interface. Servlets are initialized by the servlet containers using init() method . Servlets like any other java class can have constructors . Servlet must have a no argument constructor in case it have a non zero arguments constructor. Servlet needs an object of ServletConfig for initialization . Interfaces cannot have constructors. Can we have Constructors in a Servlet ? Yes we can, please read How a servlet is initialized by the servlet container. So this article will make clear, why we cannot use a constructor for initializing a servlet. However there is no problem in having a constructor in a servlet. We can have both argumented and no arguments constructor in a servlet. Example What we are trying to do is to create a simple servlet with a constructor and assign a value to a String variable named as "msg". Servlet : ServletConstructor package com.ekiras.demo; import java.io.IOException; im...