How destructors are defined in Java?

Discussion in 'Object Oriented Concepts' started by peter47, Oct 17, 2016.

  1. peter47

    peter47 New Member

    How destructors are defined in Java?
  2. cool_one368

    cool_one368 New Member

    Java have it's own way of taking care of destroying or destructing an object for you. it is called Garbage collection. There are no destructors in java as Garbage collection does that job for you.
  3. sm2345110

    sm2345110 Member

    For this way you may define the JAVA destructor.
    public class NoArgConstructor {
    public NoArgConstructor() {
    // Constructor body here


    All the Best :)
  4. anneroberts

    anneroberts Member

    A destructor is an extraordinary technique called naturally amid the obliteration of a protest. Activities executed in the destructor incorporate the accompanying: Recovering the store space designated amid the lifetime of a question. Shutting document or database associations. Discharging system assets.

Share This Page