title: Switch statement in java accept which datatypes
body: <p>I got a error in this code</p>
  
  <pre><code>System.out.println("enter grade ");
  Scanner input2 = new Scanner(System.in);
  String grade = input2.nextLine();
  switch(grade)
  {
    case "a":
      g=10;
      break;
    case "b":
      g=8;
      break;
    default:
     System.out.println("invalid grade");
     break;
  }
  </code></pre>
  
  <p>I am using eclipse kepler. It is giving me the correct output.</p>
  
  <p>But the same code when written in eclipse helios, it says like :</p>
  
  <p><code>Cannot switch on a value of type String. Only convertible int values or enum constants are permitted</code></p>
  
  <p>Help me fixing this.</p>