Why if condition become false value even if the ans is hell. Is there something wrong with the program or what. I am using blueJ for java.
import java.util.Scanner;
public class QuizContest
{
Scanner value = new Scanner(System.in);
public void Contest()
{
System.out.println("Please type- hell");
String ans=value.next();
if(ans=="hell")
{
System.out.println("Congratulation. You are right");
}
else
{
System.out.println("You are wrong");
}
}
}