Results 1 to 3 of 3
  1. #1
    Join Date
    May 2014
    Posts
    1
    Rep Power
    0

    Post Destructor in java

    Is there any destructor in java? if any how it works?:

  2. #2
    kneitzel is offline Senior Member
    Join Date
    Feb 2014
    Posts
    447
    Rep Power
    7

    Default Re: Destructor in java

    Java has the finalize method.
    Just search on google and you will find a lot about that e.g.
    Java Destructor - finalize() | Java Tutorials, tips, forums, faq

    Konrad

  3. #3
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    14

    Default Re: Destructor in java

    Nope. That function is handled mostly by the system garbage collector. There is a finalize method for cleaning up resources. It is called when the object is marked for garbage collection but before it is collected. Read about it here: Chapter*12.*Execution

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

Similar Threads

  1. my destructor not working
    By ansarifar in forum New To Java
    Replies: 3
    Last Post: 11-07-2010, 12:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •