Creating a dangling pointer using Java

前端 未结 5 995
既然无缘
既然无缘 2021-01-06 05:57

How can i create a dangling pointer using Java?

5条回答
  •  我在风中等你
    2021-01-06 06:25

    String foo = null;
    

    then if you try to say foo.substring(0), you'll get a NullPointerException.

    Is that what you mean?

提交回复
热议问题