Reputation: 832
For example,
WeakReference<Obj> weakObj = new WeakReference<>(obj);
Obj obj2 = weakObj.get()
In this example obj2 is strong reference type?
If yes means GC is not able to remove this reference until its parent get GCed?
Upvotes: 0
Views: 90
Reputation: 1552
Your weakObj
is a WeakReference
, and yes, get()
returns a standard reference.
Upvotes: 2
Reputation: 7649
Yes
Default references are strong references
You have some more information in this other question
Upvotes: 2