StringBuilder() vs StringBuilder(null) vs StringBuilder("")
<p>public class TestMyStringBuilderII {</p>

<pre><code>public static void main(String[] args) {
    StringBuilder sb = new StringBuilder("Hello");
    StringBuilder sb1 = new StringBuilder("World");
    StringBuilder sb2 = new StringBuilder();
    //StringBuilder sb3 = new StringBuilder(null);
    StringBuilder sb4 = new StringBuilder("");

    System.out.println(sb);
    System.out.println(sb.length());
    System.out.println(sb.append(sb1));
    System.out.println(sb.append(sb2));
    //System.out.println(sb.append(sb3));
}
</code></pre>

<p>}</p>

<p>The sb3 = new StringBuilder(null) results in NullPointerException. Now, what is the difference between StringBuilder(), StringBuilder(""), and StringBuilder(null)?</p>

<p>a) System.out.println(sb2); is printing empty space when the actual characters ("null") was expected to be appended (according to the AbstaractStringClass definition) - why? </p>

<p>b) System.out.println(sb2.length()); is printing 0, so is this because sb is not really "null" (meaning it is some thing/type with length of zero?)</p>

<p>c) System.out.println(sb4); is printing empty space and System.out.println(sb4.length()); is printing 0 (assuming clearly that sb4 is actually of String because of the double quotes used for the argument, but with zero length) - correct?</p>

<p>Not sure if this question is formulated correctly, but I would appreciate if someone who can understand my thinking/confusion here and clarify these a bit.</p>