Can we write a constructor for a Servlet class ? if yes how ?
if no why not ?
Answer Posted / abhishek taneja
yes offcourse you can write a constructor for a servlet
after all it is a java class. you can simply provide but if
u do not provide then it is by default include the no
argument constructor that is used by the Init() method in
the servlet life cycle.
| Is This Answer Correct ? | 11 Yes | 0 No |
Post New Answer View All Answers
What are advantages of servlets over cgi?
What is http servlet?
What is life cycle of Servlet?
List out the difference between ServletConfig and ServletContext?
What is servlet in tomcat?
Which is the methods of generated servlet?
Define the lifecycle for executing a jsp page.
Are Servlets Thread Safe? How to achieve thread safety in servlets?
How do you configure a centralized error handler in servlets?
What are the different methods involved in the process of session management in servlets?
What are the life cycle methods of a servlet?
What are the types of protocols supported by httpservlet ?
why we should override only no-agrs init() method.
How do I know if java is running on linux?
What is servlet used for?