Can we define constructor in Servlet class?
Answer Posted / naveen
yes we can create a constructor
by default JVM calls default constructor.In addition to that if write both default and parameterized constructor then JVM call default one and then parameterized one
hence the ans is yes we hav to write two constuctors
no if write our own constructor one itself
| Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
What are the phases of a servlet life cycle?
Why the container loads server at the application startup and how?
Which java framework is most popular?
How to handle exceptions thrown by application with another servlet?
How do I support both get and post from the same servlet?
What is servlet and its types?
What is webservlet?
What's the architecture of a servlet package?
What are the life cycle methods of the servlet?
Whats the advantages using servlets over using CGI?
Write a program to show the functionality of servlets.
request parameter how to find whether a parameter exists in the request object?
What is http servlet? Explain with the help of an example.
What are the exceptions thrown by servlets? Why?
Explain how to improve Servlet Performance?