Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

can i write finalize mthd in an EJB??

 
sarada chan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can v write main and finalize...if so will finalize gets executed??
 
Mark Spritzler
ranger
Sheriff
Posts: 17290
9
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I don't see a use case of when or why you would use it, and I wouldn't.

But, the definition of finalize for any class is always the same the way Java defines it. Whether a POJO or an EJB. When the object is garbage collected, then it runs, but only runs once, so if the object is resurrected somehow, the next time it is garbage collected, it will not run finalize again.

Mark
 
Hey! Wanna see my flashlight? It looks like this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!