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.
    package com.javacodegeeks.advanced.construction;
    public class NoArgConstructor {
    public NoArgConstructor() {
    // Constructor body here

    }
    }

    All the Best :)
     

Share This Page