posted 23 years ago
If a String is declared with no arguments it is considered to be null. The easiest way to thinks of this is by recalling that a String is an object. If the String is 'created' without arguments, then is doesn't point to anything and is, therfore, null.
<PRE>
String myString;
</PRE>
Now, if you create a String that points to an instantiated String object, but that object doesn't contain any characters, then it is consided to be empty.
<PRE>
String myString = "";
</PRE>
The difference is that you now have an reference to an initialized object and can call methods such as myString.length() without getting a NullPointerException.
Hope this clears things up a bit.
Sean