Possible Duplicate:
How do I compare strings in Java?
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.
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 + "\"");
}}