This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

destroy() method in init() method  RSS feed

 
sunny mak
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what would happen if we write destroy mtd in init mtd ? Is the destroy mtd called then ? how it works ?

[Bear edit: fixed topic title. "mtd" is not a word. Please use only real words when posting]
[ February 01, 2007: Message edited by: Bear Bibeault ]
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sunny mak:
what would happen if we write destroy mtd in init mtd ?


Do you mean invoking destroy method from within init method? If yes , destroy method would be called like any other method call.But its meant for the container to call this method.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sunny mak,
Welcome to JavaRanch!

In an effort to help you get the most from our forums, we've compiled a
list of tips for asking questions here. You can find the list in our
FAQ section here.
In particular please see:
UseRealWords


Abbreviations such as "u" or "ur" in
place of "you" and "you are" or "you're" confound language translation software making
it hard for our non-English speaking members to read your posts.
"mtd" is not a word in the English language.

Again, welcome to JavaRanch and good luck with your question.
-Ben
 
Muhammad Saifuddin
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rahul Bhattacharjee:
But its meant for the container to call this method.


agree with Rahul,

and servlet container calls the destroy method before removing a servlet instance from service. see more..
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have also had the conversation a few times, and I believe a fair summary is:

You can do this if you really want, and it is valid, but it doesn't serve any meaningful purpose and isn't really worth the effort
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it is just like any other method call and as said, it dosn't serve any purpose!
 
sunny mak
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ,
Thanks everyone . ya i have tried that and its working fine . I was asked that question in an interview, thats why i wanted to clarify that...thanks everyone .
Ben i have kept your words in mind ,Thanks .

bye
mak.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!