Friday 5 April 2013

What happens if you call destroy() from init() in java servlet?



This is a very tricky question often asked in java interviews
The simple answer to this question is that don’t  get confused by the name of the method destroy()  because it never destroy the servlet. When this method is call, The content of this method gets executed and then the respective process continues.
Programmers are not supposed to call this method. It will be invoked by the container.

No comments:

Post a Comment