Well, "String str1=NULL" it certainly ain't, because, as Bear said, there is no such thing as NULL in Java. The answer depends entirely on the context of your app. Maneesh has already pointed out how the two ways might be interpreted differently. Note that initializing a String to " " -a single space- is very unusual. The empty string -""- is much more common.
Joined: Mar 22, 2005
I did not realise both are different.
Here's a very important question, then: What do you think "null" means? I'm baffled how one could think that it's the same as a one-character string.