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 is the difference between the http servlet and generic servlet?
How is a servlet implemented in code?
What is difference between the HTTP Servlet and Generic Servlet? Explain about their methods and parameters?
What do you mean by servlet context?
What is java servlet session?
What is servlet interface?
Explain the architechure of a servlet?
What are the uses of servlets?
Can we fetch the attributes related to a servlet on a different servlet?
Once the destroy() method is called by the container, will the servlet be immediately destroyed? What happens to the tasks(threads) that the servlet might be executing at that time?
Write a command to get actual path of a servlet to the server?
What do you mean by interservlet communication?
How can we include static files in the jsp page?
What is the use of servlet context?
How do you invoke a servelt?