title: Java error, duplicate local variable
body: <p>I'm trying to debug a portion of code for an assignment (I'm still very new to Java) and have combed through many resources to solve this conflict but still can't quite work it out. </p>
  
  <pre><code>public static void main(String [] args){
      Scanner keyboard = new Scanner(System.in);
      String input = null;
      do
      {
        System.out.println("Enter 'A' for option A or 'B' for option B.");
        String input = keyboard.next();
        input.toLowerCase();
        input.charAt(0);  
      }
      while ((input != "a") || (input != "b"));
  }
  </code></pre>
  
  <p>I always get a Duplicate Local Variable error with the input String. </p>
  
  <p>Any help would be greatly appreciated!</p>