title: difference between (string == null) and (string.length() == 0)?
body: <p>I got different simulation results when I programmed in these two ways:</p>
  
  <pre><code>if (S == null) {
          return new LinkedList&lt;&gt;();
      }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>int len = S.length();
  if(len == 0) return new LinkedList&lt;&gt;();
  </code></pre>
  
  <p>The first code gave me [""], which passed the testing. While the second one gave me [], got failed.
  And I also noticed that there is another way: S.isEmpty()</p>
  
  <p>Would anyone please explain? Many thanks!</p>