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
What do you mean by deployment descriptor?
How the servlet is loaded?
How can we implement a jsp page?
What is the difference between encodeRedirectUrl and encodeURL?
What is the need of servlet filters?
Explain request dispatcher and its methods.
Explain the concept of ssi ?
What does the term localization refer to?
What do you mean by httpservlet and how it is different from the genericservlet?
Can you call a jsp from the servlet?
Explain the difference between servletconfig and servletcontext in servlet?
Does servlet have main method?
Which method is called when reference variable is passed in system.net?
What is the importance of init() method in Servlet ?
How do I use cookies to store session state on the client?