How to determine whether a constant is an obsolete constant?

The run-time constant pool mainly reclaims obsolete constants.

If the string "abc" exists in the constant pool, if there is no String object currently referencing the string constant, it means that the constant "abc" is an obsolete constant. If memory reclamation occurs at this time and necessary, "abc" Will be cleared out of the constant pool by the system.

Guess you like

Origin blog.csdn.net/hello_cmy/article/details/105912842