title: Java: Do While with || and && operators
body: <p>so I'm a bit confused on the following:</p>
  
  <p>While testing the Boolean, my first impression was to use the || operator for the conditions. This did not work, the loop would keep repeating for a correct response. But if I used the &amp;&amp; operator, then it would evaluate the conditions the way I wanted it to.</p>
  
  <p>I feel like this is backwards, and I'm not looking at it right. Can anyone explain this?</p>
  
  <p>To make it more clear, what I was originally trying to do:</p>
  
  <pre><code>    String input;
  Scanner keyboard = new Scanner(System.in);
  
  do
  {
      System.out.print("Enter one of the following names: John, Katie, Richard");
      input = keyboard.nextLine();
      input = input.toLowerCase();
  
  } while ( !input.equalsIgnoreCase("John") &amp;&amp; !input.equalsIgnoreCase("Katie") &amp;&amp; !input.equalsIgnoreCase("Richard"));
  </code></pre>
  
  <p>I want the loop to repeat until one of the given names is entered. So if I entered katie, it should move on, but if I enter bob it should repeat.</p>
  
  <p>So if I enter john, the boolean first checks that. !(john = john) which is  FT = false.
  since I just want to check to see if it is equal to john, not richard or katie I would want to use the || operator. Why would I also want to check if its equal to those names anyway.</p>