+ 2
Can I consider s as null string? S==null will be true?
String s = "";
2 Respostas
+ 9
According to me,both are different coz String s="" represent an empty string and null represent no value or no storage location.
For more detailed information check this:
https://stackoverflow.com/questions/4802015/difference-between-null-and-empty-java-string
0
If you need a true statemet for an empty string, you can check its length.
len(s)==0
(you can even ignore the "==0", because 0 == False, 1 == True. any values above 1 is also True)