Can we write a constructor for a Servlet class ? if yes how ?
if no why not ?
Answer Posted / sekhar babu
yes, we can write constructor on our own but it should be
no argument public constructor only, cause container will
create the object so it needs no argument constructor.
| Is This Answer Correct ? | 22 Yes | 1 No |
Post New Answer View All Answers
Explain the lifecycle of a servlet?
What are the uses of servlet and what is servlet chaining?
What is the life-cycle of servlets?
What do you mean by a filter and how does it work?
Can we use the constructor, instead of init(), to initialize servlet?
What is dispatcher servlet?
How to create war file?
What is the main purpose of java servlets?
What are different ways for servlet authentication?
Can you create a deadlock condition on a servlet?
How can we refresh automatically when new data is entered into the database?
What is http servlet?
What is servletconfig?
What is the disadvantage of cookies?
What is a servlet engine?