S
S
snqL2015-01-23 17:51:33
Java
snqL, 2015-01-23 17:51:33

Where is PhantomReference (Java) used?

Where is PhantomReference used? I would like examples where this may be needed in practice.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikita, 2015-01-23
@jkotkot

It's written in the documentation. "Phantom references are most often used for scheduling pre-mortem cleanup actions in a more flexible way than is possible with the Java finalization mechanism."
In reality, in 10 years of programming, it has never been needed and has never been used. I think that is suitable for some tricky release of native resources. A kind of advanced finalize.

A
angry_cellophane, 2015-06-17
@angry_cellophane

habrahabr.ru/post/169883

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question