explain the term - garbage collectionjava


Explain the term - Garbage Collection

Java  performs  garbage  collection  and  eliminates  the  need  to  free  objects  explicitly.  When an object  has  no references   to   it  anywhere  except  in  other  objects   that  are  also unreferenced, its space can be reclaimed.

Before  an  object  is  destroyed,  it  might  be  essential for  the  object  to  perform  some  action.  For  illustration:

to  close  an  opened  file.  In  such  a  case,  define  a  finalize() method with  actions  to be performed before object is destroyed.

 

 

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: explain the term - garbage collectionjava
Reference No:- TGS0356467

Expected delivery within 24 Hours