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

Answer Posted / ravi

No..not at all,,,,servlet is a class which is dynamically
loaded...dynamically loaded class never requires
constructors.

Is This Answer Correct ?    8 Yes 18 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is cookie in servlet?

591


What is difference between cookies and httpsession?

544


What are the steps that are involved in using the httpservlet class?

572


How many objects of a servlet is created?

788


What is the difference between CGI and Servlet?

584






How to create war file?

609


What is meant by session? Tell me something about httpsession class?

596


What’s the difference between sendredirect and forward methods

562


Can servlet have a constructor ?

595


What mechanisms are used by a Servlet Container to maintain session information?

664


Why is it that we can't give relative URL's when using ServletContext.getRequestDispatcher() when we can use the same while calling ServletRequest.getRequestDispatcher()?

614


Is servlet a server side scripting language?

553


Why is a constructor needed in a servlet even if we use the init method?

602


What is Request Dispatcher?

794


Describe in brief RequestDespatcher?

592