IS there a way to set a garbage collector only for one type, like in Objective C when you do [Oppsie release]; Or is there a similar way in Java. I was thinking for setting Oppsie to null but I don’t think it’s similar to release.
Any suggestions?
Once you set Oppsie to null and is no longer reachable by any other reference, Java will set it as unreachable and mark it for garbage collection. You will no longer be able to reference it and Java will eventually GC it.