• Strong reference (finalreference), in Java, a bit like C + + pointers, by reference, you can manipulate the objects in the heap. Strong references have the following characteristics:
1. Strong reference can directly access the target object;
2. The object pointed by a strong reference will not be reclaimed by the system at the time of the task;
3. Strong references can lead to memory leaks.
• Soft Reference (softreference), a soft reference object that the garbage collector determines whether to clear the object when responding to memory needs. An object holding a software reference will not be quickly recycled by the JVM, as long as there is enough memory, the software reference may survive in memory for a long time, soft reference objects are most commonly used to realize memory-sensitive caching;
• Weak reference (weakreference), weak reference is a relatively weak reference type, when the system GC, as long as the discovery of weak references, regardless of the system heap memory is sufficient, will be the object recycling;
• Virtual Reference (phantomreference), a virtual reference is the weakest of all references, and an object holding a virtual reference is almost the same as not being referenced and may be reclaimed by the garbage collector at any time.