[英]Does displaying/printing a null value cause NullPointerException
Does displaying/printing a null value cause NullPointerException
or does only trying to manipulate it? 显示/打印null值是否会导致NullPointerException
或仅尝试对其进行操作?
If I had an array A
and an array B
which was twice the size of A
. 如果我有一个数组A
和一个数组B
,其大小是A
两倍。 If I copied all the elements from A
into B
using 如果我使用将所有元素从A
复制到B
Arrays.copyOf(A, 2*A.length)
When I print B
using Arrays.toString(B)
, it happily prints out even null
values without throwing any exceptions. 当我使用Arrays.toString(B)
打印B
,它愉快地打印出了null
值,而没有Arrays.toString(B)
任何异常。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.