相关疑难解决方法(0)

在Java中连接空字符串

为什么以下工作?我希望有人会NullPointerException被扔掉.

String s = null;
s = s + "hello";
System.out.println(s); // prints "nullhello"
Run Code Online (Sandbox Code Playgroud)

java string concatenation string-concatenation

157
推荐指数
5
解决办法
11万
查看次数