Organizational Research By

Surprising Reserch Topic

difference between null and empty java string


difference between null and empty java string  using -'java,string,null,equals,referenceequals'

What is the difference between null and the "" (empty string)?

I have written some simple code like this:

String a = "";
String b = null;

System.out.println(a==b); // false
System.out.println(a.equals(b)); // false


And both statements return false. It seems, I am not able to find what is the actual difference between them.
    

asked Oct 19, 2015 by r3tt
0 votes
11 views



Related Hot Questions

10 Answers

0 votes
NULL
answered Oct 19, 2015 by rajeshujade
0 votes
NULL
answered Oct 19, 2015 by sachin wagh
0 votes
NULL
answered Oct 19, 2015 by yogeshplv
0 votes
NULL
answered Oct 19, 2015 by abhimca2006
0 votes
NULL
answered Oct 19, 2015 by mannumits1
0 votes
NULL
answered Oct 19, 2015 by shegokar.anjeet
0 votes
NULL
answered Oct 19, 2015 by vijaygupta1980
0 votes
NULL
answered Oct 19, 2015 by abhi
0 votes
NULL
answered Oct 19, 2015 by akhilesh
0 votes
NULL
answered Oct 19, 2015 by okesh.badhiye

...