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 is the importance of init() method in Servlet ?
Why servlet is faster than jsp?
What are the disadvantages of storing session state in cookies?
How we can call a jsp from the servlet?
How can we achieve transport layer security for our web application?
What are the different methods of session management in servlets?
What's the servlet interface?
If servlet receives multiple requests, how many objects will it create?
What is the use of attribute in servlets?
When to use doget() and when dopost()?
Why is Servlet so popular?
How do you run a servlet?
What is httpservlet and how it is different from genericservlet?
What is the difference between genericservlet and httpservlet
Why session tracking is needed?