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 supporting protocol by HttpServlet ?
What is the difference in between the httpservlet and generic servlet?
What do you mean by filter in servlet?
What is the process for chaining servlet?
What do you mean by request dispatcher in servlet? Also explain its methods.
What do you mean by servlet context?
How do you design microservices?
What are the life cycle methods of a servlet?
What is servlet mapping?
Explain web application directory arrangement?
How do you run a servlet?
Whether thread can be used in servlets?
What is the difference between Server and Container?
What is the use of servlet context?
When should you prefer to use doget() over dopost()?