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


Please Help Members By Posting Answers For Below Questions

Is servlet a framework?

745


What is the major difference between context parameter and context attribute?

828


What is the use of httpservletresponsewrapper?

704


What is a cookie What is the difference between session and cookie

811


Differentiate between get and post?

883


What are the differences between the servletconfig interface and the servletcontext interface?

839


What do you mean by a filter and how does it work?

711


Why HttpServlet class is declared abstract?

848


Difference between GET and POST?

894


What is the difference between genericservlet and httpservlet

766


Why servlet is used as controller ? Not JSP? I want complete explation?

878


What are the uses of servlet

819


How can a servlet be used to generate plain text instead of html?

741


Explain servlet events?

740


How forward () method is different from send redirect () method?

708