title: Multiple string conditions in an if statement
body: <p>I'm writing a simple program and in it I need to get a user's input for yes/no (I'm using Scanner, UI, for this) like so:</p>
  
  <pre><code>    System.out.println("Do you know the insulation capacity? (y/n) ");
      String IC = UI.nextLine();
  </code></pre>
  
  <p>And that works perfectly fine, but I have trouble in the next section, where I check the string in an if statement:</p>
  
  <pre><code>    if(IC == "y" || IC == "Y" || IC == "yes" || IC == "Yes"){ //four options of saying "yes"
          System.out.print("What is the insulation capacity? ");
          m = UI.nextDouble();
      }else if(IC == "n" || IC == "N" || IC == "no" || IC == "No"){ //four options of saying "no"
          findM();
      }else{
          System.out.println("Answer was not clear. Use y, n, yes, or no.");
          checkM();
      }
  </code></pre>
  
  <p>When I run the program, the else is always executed, even if IC is Y, y, Yes... etc.</p>
  
  <p>Why is this the case and how do I get this to work?</p>
  
  <p>Thanks,</p>
  
  <p>-Justice</p>