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

Answer Posted / saikiran

that is one of the specification rule that
1.instantiated by constructior with no argument.
2.implementd class should be public and non-abstract.
3.should be implemnt javax.servlet.Servlet
We can Write it

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If some new data has entered the database, explain how can a servlet refresh automatically?

975


Why do we need servlet filter?

765


Can we refresh servlet in client and server side automatically?

775


What is servlet initializer?

686


Can you call a jsp from the servlet?

734


Explain the difference between get and post method in servlet?

828


What are the differences between forward() method and sendredirect() methods?

745


What is the difference between jsp and servlet life cycle?

931


What is a servlet-to-servlet communcation?

849


What methodology can be followed to store more number of objects in a remote server?

1999


Why are http servlets used in programming?

734


What's the advantages using servlets than using cgi?

720


What is ServletConfig object?

814


What is life cycle of Servlet?

787


What is the difference between using getSession(true) and getSession(false) methods?

788