There is no destructor in Java. Justify.

Posted By on September 16, 2014


Download PDF
A protected data or method can be accessed by any class in the same package. Justify.
Java Classes and Objects
There is no Destructor  in JAVA   Since JAVA is garbage collection  enabled language .
finalize()  method  can be used as Destructor  . It just  throws   a hint to JVM that the object   can  be clean up but  you cannot ensure that the  object has been destroyed .At the End it is the GC   which destroys the Object  .
note : Never  use finalize() method  until  your  sure that  the object is no longer  required   .
A protected data or method can be accessed by any class in the same package. Justify.
Java Classes and Objects

Download PDF

Posted by Akash Kurup

Founder and C.E.O, World4Engineers Educationist and Entrepreneur by passion. Orator and blogger by hobby

Website: http://world4engineers.com