title: Scanner & if-then-else issue
body: <p>I am trying to create a result (result1) based off of user input. I have gotten an error saying result1 may not have been initiated. If i add it to the code above by inputing <code>int result1 = 0;</code> my if-then-else statements causes <code>system.out.println(result1);</code> gives me a result of 0 every time. It skips over my if-then-else statements completely. Shouldn't result1 be initiated as soon as the user inputs a string? I appreciate any advice or insight that can be given.</p>
  
  <pre><code>import java.util.Scanner;
  
  public class Main {
  
      public static void main(String[] args) {
  
  
          Scanner sc0 = new Scanner(System.in);
          System.out.print("What would you like to do?: (A)Addition (B)Subtraction (C)Multiplication (D)Division: ");
          String input0 = sc0.nextLine();
  
          Scanner sc1 = new Scanner(System.in);
          System.out.print("Enter a number: ");
          String input1 = sc1.nextLine();
  
          Scanner sc2 = new Scanner(System.in);
          System.out.print("Enter a number: ");
          String input2 = sc2.nextLine();
  
          int int1 = Integer.parseInt(input1);
          int int2 = Integer.parseInt(input2);
  
  
          if (input0 == "A")
          {
              result1 = int1 + int2;
          }
          else if (input0 == "B")
          {
              result1 = int1 - int2;
          }
          else if (input0 == "C")
          {
              result1 = int1 * int2;
          }
          else if (input0 == "D")
          {
              result1 = int1 / int2;
          }
          else {
              System.out.println("You have entered an invalid option.");
              System.exit(0);
          }
  
  
          System.out.println("Your result is, " + result1 + "!");
  
  
  
      }
  }
  </code></pre>