Selasa, 27 Juli 2021

Difference between WeakReference vs SoftReference vs PhantomReference in Java? Example

WeakReference and SoftReference were added into Java API for a long time but not every Java programmer is familiar with it. This means there is a gap between where and how to use WeakReference and SoftReference in Java. Reference classes are particularly important in the context of How Garbage collection works. As we all know that Garbage Collector reclaims memory from objects which are eligible for garbage collection, but not many programmers know that this eligibility is decided based upon which kind of references are pointing to that object. This is also the main difference between WeakReference and SoftReference in Java.

Lorem ipsum is simply dummy text of the printing and typesetting industry.

Comments


EmoticonEmoticon