title: Scanning char validating with while
body: <p>The complex condition in the <code>while</code> (check if there is input, and if its different to <code>m</code> or <code>f</code>) is not working:</p>
  
  <pre><code>System.out.println("Insert gender (m / f)  ");
  while (!stdin.hasNext() &amp; !(temp = stdin.next()).equals("m") &amp; !(temp.equals("f"))) {
      System.out.println("try again");stdin.nextLine();
  }
  inpSexo = temp.charAt(0);
  </code></pre>