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 are the new features added to servlet 2.5?
What are important features of Servlet 3?
Which method is called when reference variable is passed in system.net?
What are different ways for authentication of servlet?
What is servlet looping or chaining?
When servlet is loaded?
What is a servlet?
Difference between forward() method and sendredirect() method ?
How to upload a file to the server using servlet?
How can we upload the file to the server using servlet?
Explain the war file?
What is the use of httpservletrequestwrapper?
Explain the role of dispatcherservlet and contextloaderlistener.
Why do we need a constructor in a servlet if we use the init method?
How to generate the server side programming and the advantages of it over the other languages?