I have this code:
Scanner reader = new Scanner(System.in);
System.out.println("Enter the first number");
String l =reader.next();
String[] a = new String[2];
a[0] = l ;
a[1] = "5";
if((String) a[0] == "5" )
{
System.out.println("hey");
}
however if I enter "5" as my input, "hey" is not printed how do I get it so that I can use an if statment to see if what is entered is a certain character or word