Can we write a constructor for a Servlet class ? if yes how ?
if no why not ?

Answer Posted / ravikiran

we cann't write a constructor because the servlet container
will create the instance of the servlet by calling the
no-arg constructor

Is This Answer Correct ?    1 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When servlet object is created?

797


What are different Authentication options available in Servlets.

771


What are sessions in servlets?

780


How to get the actual path of servlet in server?

949


Why doesn’t a servlet include main()? How does it work?

854


What is the major difference between servlet and applet?

741


What is the use of java servlet api?

774


Explain servlet.

771


How would you create deadlock on your servlet?

824


What are life cycle methods of a servlet?

777


What is the procedure of invoking different servlet in a different application?

761


Why jsp is better than servlet?

732


What is dispatcher servlet?

780


What is the difference between the include() and forward() methods?

788


why we should override only no-agrs init() method.

868