What is the difference between null
and the \"\"
(empty string)?
I have written some simple code:
String a = \"\";
String b
Amazing answers, but I'd like to give from a different perspective.
String a = "StackOverflow";
String a1 = "StackOverflow" + "";
String a2 = "StackOverflow" + null;
System.out.println(a == a1); // true
System.out.println(a == a2); // false
So this can tell us "" and null point to the different object references.