title: Use switch statement to compare a string against an enum
body: <p>I'm making (my own version of)roulette with Java, and one of the types of bets a player can make is to choose the color that is going to be rolled. (Even is black, odd is red). Is there a way I can use a switch statement to compare a string against an enum?</p>
  
  <pre><code>private enum colors{red, black};
  private String colorGuess;
  private boolean colorVerify = false;
  public void getColorGuess(){
  do{
  Scanner in = new Scanner(System.in);
  colorGuess = in.nextLine();
  switch(colors){
  case red:
      colorVerify = true;
      break;
  case black:
      colorVerify = true;
      break;
  default:
      System.out.println("Invalid color selection!");
      break;
  }while(colorVerify = false);
  </code></pre>
  
  <p>This is what i'm trying to get but it's not letting me use the enum 'colors' in a switch statement.</p>