Can we call destroy() method inside the init() method? What
happens when we do so?

Answer Posted / poorna chandar rao.yerrabothu

if suppose we take the servlet programming side then
whenever u type the URL first web browser call the service
method then create the servlet object then call the
init()method whenever we call the init method start the
proceesses of the particular object operation suppose we
call the destroy()method before completion of the particular
object operation servelet object is removed then when we r
call the service method then create the servelet object

Is This Answer Correct ?    11 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by request dispatcher in servlet?

589


How do you design microservices?

598


Explain request dispatcher and its methods.

565


What are the uses of servlet and what is servlet chaining?

538


Which application server is best for java?

533






How to handle exceptions thrown by application with another servlet?

594


How to notify an object in session when session is invalidated or timed-out?

606


What is difference between jsp and servlet?

612


Which are the different ways you can communicate between servlets?

498


Explain the role of dispatcherservlet and contextloaderlistener.

575


What do you mean by httpservlet?

543


What is new in ServletRequest interface ? (Servlet 2.4)

559


What is the life cycle of a servlet?

754


Is servlet synchronized?

578


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

521