更新时间:2022-11-23 16:12:39
o
might get garbage collected once it is not reachable any longer, whether it is final or not. Obviously, as long as execute
is running, if it needs to access o
, it will prevent GC.
When execute
is done running, and assuming you have not stored any references to o
(for example in a collection), it will be flagged as ready for garbage collection.