06 Java - Memory Management and Garbage Collector
Types of Memory
There are 2 types of Memory
STACK
HEAP
Both stack and Heap are created by JVM and stored in RAM.
Stack Memory
Store Temporary variables and separate memory block for methods.
Store Primitive data types
Store Reference of the h...
chetan77.hashnode.dev6 min read
Sukhvir Kaur
❓ "Soft Reference is a type of Weak Reference" — is this correct?
❌ Technically Incorrect While both SoftReference and WeakReference are part of the same reference family (i.e., they are subclasses of java.lang.ref.Reference), SoftReference is not a subtype of WeakReference.
✅ Correct Statement: "SoftReference and WeakReference are two different types of non-strong references. Both extend the abstract class Reference, but neither is a subtype of the other."