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 cgi?
What is cookie? Why is cookie used?
Explain the lifecycle of a servlet?
What is the main purpose of java servlets?
Explain jsessionid?
What is the difference between Servlets and Applets?
Where do you define dispatcherservlet?
Write the code to get the server information in servlet.
Differentiate between the web server and application server?
What is load-on-startup in servlet?
What is a java servlet?
Explain session tracking and its importance?
Explain url encoding?
How to read request headers from servlets?
What is the default http method in the servlet?