When I try to concatenate a String
that is actually null with a valid string (eg "a"), I get the value nulla
. See the example below:
String a = "a";
String b = null;
System.out.println(b + a);
I wanted the output to be just "a". Is there any way to do this without checking whether String
is null
?