Check out example codes for "delete object java". It will help you in understanding the concepts better.

Code Example 1

Object a = new Object();a = null;// after this,if there is no reference to the object, // it will be deleted by the garbage collector

Learn ReactJs, React Native from akashmittal.com