Why can't my program use my assigned string operator to calculate the two integers?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/513832/how-do-i-compare-strings-in-java">How do I compare strings in Java?</a>  </p>
</blockquote>



<p>Why can't my program use my assigned string operator to calculate the two integers? For some reason its as if the program is not accepting the input from the user.</p>

<pre><code>import java.io.*;

public class IntCalc {
    public static void main (String [] args) throws IOException {
        BufferedReader kb = new BufferedReader (new InputStreamReader (System.in));

        System.out.println ("This program performs an integer calculation of your choice.");

        System.out.println ("Enter an integer: ");
        int x = Integer.parseInt (kb.readLine());

        System.out.println ("Enter a second integer: ");
        int y = Integer.parseInt (kb.readLine());

        System.out.print ("Would you like to find the sum, difference, product, quotient, or remainder of your product?: ");
        String operator = kb.readLine();

        int finalNum;

        if (operator == "sum") {
            int finalNum = (x + y);
        } else if (operator == "difference") {
            int finalNum = (x - y);
        } else if (operator == "product") {
            int finalNum = (x * y);
        } else if (operator == "remainder") {
            int finalNum = (x % y);
        }

        System.out.print ("The " + operator + " of your two integers is " + finalNum ".");
    }
}
</code></pre>
