can i call init() method in destroy() method of servlset. ?

Answers were Sorted based on User's Feedback



can i call init() method in destroy() method of servlset. ?..

Answer / gayathri janarthanam

One can programatically call destroy() from init(), though it is not recommended. it will be invoked like a regular java method call..Whatever code is written in the destroy method will run....It will not destroy the servlet...Only the servlet container can call the destroy() method to actually destroy a servlet....

Is This Answer Correct ?    4 Yes 0 No

can i call init() method in destroy() method of servlset. ?..

Answer / suresh

when the sevlet is load the class files,in this time to call
init() method is called

destroy method used to the servlet remove from the memory

Is This Answer Correct ?    6 Yes 3 No

can i call init() method in destroy() method of servlset. ?..

Answer / arulmani

init()method will be called by the webcontainer with the
servlet object by passig the ServletConfig object,when the
servlet object will be created.

destroy()method will be called by the webcontainer when
servlet object will be destroyed

Is This Answer Correct ?    1 Yes 0 No

can i call init() method in destroy() method of servlset. ?..

Answer / giridhar gangapatnam

I think it is not possible to call init() method from
destroy() method of servlet.

Is This Answer Correct ?    1 Yes 1 No

can i call init() method in destroy() method of servlset. ?..

Answer / jimmi prajapti

Yes We can Call init() method from destroy() of Servlet

Is This Answer Correct ?    5 Yes 7 No

Post New Answer

More Servlets Interview Questions

What are the objects involved when a servlet receives a call from client?

0 Answers  


What is a web application and what is it’s directory structure?

0 Answers  


init() method of servlet loaded by?

3 Answers  


Can we override destroy method in servlet?

0 Answers  


What must be implemented by all servlets?

0 Answers  






What compiler do not do if we create our own constructor?

5 Answers   HCL,


In the servlets, we are having a web page that is invoking servlets ,username and password? which is checks in database? Suppose the second page also if we want to verify

0 Answers  


What are sessions in servlets?

0 Answers  


What is the <load-on-startup> element?

0 Answers  


What is the process to implement doget and dopost methods?

0 Answers  


What are the types of servlets? Explain

0 Answers  


What is webservlet?

0 Answers  


Categories