Strings just don't match? Java
<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>I am trying to make it so that when I type hope, b will save hope and then it will recognize c == b, and you get the picture. What do I do? I am new to Java and I apologize if this is a no brainer.</p>

<pre><code>package encryption;
import java.util.Scanner;

public class Encrypt


{


public static void main (String[] args)

{

Scanner scan = new Scanner(System.in);

String test1 = new String("Enter now: ");
String d = new String("Success!");
String e = new String("Failure");
String b = new String();
String c = "hope"


System.out.print("Enter text: ");
b = scan.next();

if (b == c)
System.out.println("\"" + d + "\"");
else
    System.out.println("\"" + e + "\"");

}}
</code></pre>
