• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet Destroy method

 
Naresh Gangapur
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please help on the below mock exam question (from Java Beat)-

What might be the output of the following program if a HTTP GET Request is
made on the Servlet object?



Ans mentioned was - The program will output 'ctor init doGet destroy'.

But as per me, the destroy method will not or might not be called after serving a client's request. It could be happen when the container removes the Servlet instance. I was curious if an option was mentioned as None of the above, do we mark that or the above choice as mentioned by the author.
Can someone please help or correct.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question is : What might be the output of the following program if a HTTP GET Request is made on the Servlet object?
 
Naresh Gangapur
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, so have to be cautious on the exact verbatim too
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic