Answer Posted / chandra kunchala
yes ofcourse we should.
it is mandatory for servlet.
for servlets we required publc no argument constructor. if v
don't having that one, our servlet should not work, even
though if you are not crating the public no-argument
constructor, the java compiler will take the responsibility
to create public no- argument constructor.. mean while your
servlet should be public otherwise you will get
RuntimeException.
we can create costructor for sevelet but it should b no-
argument constructor. and u r servlet should be public.
and one more thing this constructor in not in the place of
init() method..
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
What is context in servlet?
How to notify an object in session when session is invalidated or timed-out?
How is an application exception handling is done using a servlet?
Describe servlet?
When using servlets to build the HTML, you build a DOCTYPE line, why do you do that?
What do you mean by servlet?
How do we go with database connection and log4j integration in servlet?
What's the servlet interface?
Explains the differences between context.getrequestdispatcher() and request.getrequestdispatcher()?
What are the common methods that are included in the http servlet class?
Does servlet have main method?
Why servlet is mostly used?
What is a web container and what is its responsibility?
How can I send user authentication information while making URL Connection?
Explain how does JSP handle run-time exceptions?