WeakReference to String and String constants

后端 未结 2 1328
闹比i
闹比i 2021-01-12 17:34

I have come across this example from wikipedia regarding weak reference:

import java.lang.ref.WeakReference;

public class ReferenceTest {
        public sta         


        
2条回答
  •  一向
    一向 (楼主)
    2021-01-12 18:29

    If this reference object has been cleared, either by the program or by the garbage collector, then this method returns null.

    very well explained here

提交回复
热议问题