import java.io.*;

public class MenuExample {

  /**
   * Note the "...throws IOException"  This is necessary since the readLine call
   * below could fail.  Don't worry about this now.  Just know that it is
   * required.  Also note that this menu will not prompt again if the user
   * enters an invalid choice.
   */
  public static void main(String[] args) throws IOException {
    // set up System.in for character reading
    BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));

    // print menu to screen
    System.out.println("Please make a selection from the following menu.");
    System.out.println("Are you:");
    System.out.println("1) Male");
    System.out.println("2) Female");
    System.out.print("> ");
    System.out.flush();

    // read input in the form of a String
    String input = stdin.readLine();

    // convert to an int
    int menuChoice = Integer.parseInt(input);

    // find out what user selected

    switch (menuChoice) {
      case 1:
        System.out.println("Hello sir.");
        break;
      case 2:
        System.out.println("Hello miss.");
        break;
      default:
        System.out.println("Unrecognized menu choice.5");
        break;
    } // switch

  } // main

} // MenuExample