What is the difference between null
and the \"\"
(empty string)?
I have written some simple code:
String a = \"\";
String b
"I call it my billion-dollar mistake. It was the invention of the null reference in 1965" - https://en.wikipedia.org/wiki/Tony_Hoare
With respect to real world both can be assumed same. Its just a syntax of a programming language that creates a difference between two as explained by others here. This simply creates overhead like when checking/comparing whether string variable has something, you have to first check if its not null and then actual string comparing ie two comparisons. This is a waste of processing power for every string comparisons.
Objects.equals() checks for null before calling .equals().