Like any java classes, servlets also have constructors. If you don't write one, there will still be the default constructor. You must have a no-argument constructor, because the container needs it to instanciate it. You're not supposed to do anything in the constructor. Initialization should be done in the "init" method.