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
Why do we use sendredirect() method?
What do you mean by deployment descriptor?
What do you mean by servlet?
Can we override destroy method in servlet?
Why the container loads server at the application startup and how?
Differentiate between the web server and application server?
Which are the different ways you can communicate between servlets?
How will you pass values from HTML page to the servlet?
Can we fetch the attributes related to a servlet on a different servlet?
Explain the architechure of a servlet?
What are the servlet events?
How to commuincate between an applet and a servlet?
What is servlet configuration?
When servlet object is created?
How do I know if java is running on linux?