Malatesh Karabisti wrote:why I can't write my own constructor in Servlet?
You can. What is preventing you?
what are the consequence if I write it?
Everyone will think that you don't know what you are doing.
Can any body please explain ?
The
init() method is the proper place to initialize a servlet as the ServletConfig instance has been established by then. Constructors are not useful and are not usually used (I have, in fact, never written a servlet constructor in over a decade of writing servlets).