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...

Markdown supported · ⌘↵ to post
In Mark and Sweep, the referenced objects are marked and unreferenced objects are swept from heap.
Working of Grabage Collector say otherwise.
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."