title: Possible to have switch(java.lang.Object) in java?
body: <p>My application required to have switch case statement of type <code>String</code>. </p>
  
  <p>I need something like this:</p>
  
  <pre><code>    Object list1 = "list1";
      Object list2 = "list2";
      Object list3 = "list3";
  
      Object option = "list1";
      switch (option) {
          case list1: // Do something
          case list2: // Do something
          case list3: // Do something
          default:    // Do something
      }
  </code></pre>
  
  <p>Is it possible to have?</p>
  
  <blockquote>
    <p><strong>EDIT:</strong></p>
    
    <p>Is it better to use switch case for <code>n</code> conditions rather going with <code>if</code>
    and <code>else</code>? Please comment on it?</p>
  </blockquote>