title: Why won't this If statement work for the string?
body: <pre><code>import java.util.Scanner;
  </code></pre>
  
  <p>public class Methods {</p>
  
  <pre><code>/*
   * Compound interest Program Quarterly
   */
  
  
      public static void main(String[] args) {
          Scanner keyboard = new Scanner  (System.in);
  
          System.out.println("What is the Rate");
          int rate = keyboard.nextInt()/100;
          System.out.println("What is the Amount");
          int amount = keyboard.nextInt();
          System.out.println("How many years?");
          int years = keyboard.nextInt();
  
          keyboard.nextLine();
          System.out.println("How is it compounded? Press Q = Quarterly, A = Anually, S = SemiAnnualy, M = Monthly");
  
          String answer = keyboard.nextLine();
  
         int easy = amount*(1+(rate/years));
         int pow = 4 * years;
  
  
          if (answer == "/Q"){
              System.out.println("Your answer compounded Quarterly is: "  + Math.pow(easy,pow));
  </code></pre>
  
  <p>This is the code, but the if statement with String == "Q" doesn't work because when I press Q nothing happens? what's the issue?</p>