the switch statement is valid for comparing BYTE/Char//Short/Int variables..Am i wrong?
<p>i saw this code somewhere </p>

<pre><code> switch(greet){
  case HELLO:
      System.out.println("Formal Greeting");
      break;
  case HI:
      System.out.println("Friendly Greeting");
      break;
  case YO:
      System.out.println("Informal Greeting");
      break;
  default:
      System.out.println("Person did not greet");
 }
</code></pre>

<p>It did not mention the type of datatype of the <strong>greet</strong> variable against which the cases are being checked.. but it's east to figure out that it's <strong>neither a  byte,nor is it a Short or Int</strong> So logically the last permissible data type left for the switch block to accept as a variable is the <strong>char</strong> data type but i believe that char only takes single values like 'c' or '3' ..so how do such big values like <strong>hello</strong> get evaluated? what is the possible explanation?</p>
