title: Empty String to indicate object state
body: <p>From time to time I bump into code like this:</p>
  
  <pre><code>...
  private final JButton addButton = new JButton(...);
  private String warningMsg = "";
  
  private void update(){
      addButton.setEnabled(warningMsg != null &amp;&amp; warningMsg.isEmpty());
  }
  ...
  </code></pre>
  
  <p>As you can see, <code>warningMsg</code> possibly holds a warning message. When no message is needed, it will hold the empty string <code>""</code>/ Based on this behavior, a button gets enabled or disabled.</p>
  
  <p>There are 2 things that are bothering me. First, why not set <code>warningMsg</code> to <code>null</code> if the string is not needed? I consider <code>null</code> a better choice, as an empty string is still a valid string to me. An outsider cannot know he has to check for emptiness, but if the string is null, that is something he can see. Second, behavior is based on the content of a string, which is in my opinion, poor coding.</p>
  
  <p>The question is mainly about the first issue. Do you consider an empty string a good choice to indicate "nothing", which is infact a specific object state?</p>