Can we define constructor in Servlet class?

Answer Posted / sanjeev kumar

We never can create the Servlet instance. hence there is no
chance of having constructor in servlets. Servlet life
cycle methods (init(), service(), destoy())are called by
the servlet container.

Is This Answer Correct ?    4 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you get the ip address of the client in servlet?

746


Which HTTP method is non-idempotent?

804


What are the various ways of session supervision in servlets?

744


What do you mean by httpservlet?

754


What are the mechanisms used by a servlet container for maintaining session information?

768


What exception should be thrown when servlet is not properly initialized?

760


Explain mvc pattern.

762


Given the request path below, which are context path, servlet path and path info?

757


What are the steps that are required to handle the multi-threading?

853


What is meant by Servlet? What are the parameters of service method?

802


What is the use of welcome-file-list?

760


Why servlet is faster than jsp?

762


What is servlet in tomcat?

774


What are the different methods involved in generic servlet?

805


How do you invoke a servelt?

826