I am beginner in Java and i have a question while trying to learn Strings . In the below program
String st1="Test";
String st2="TEST";
String st3= st1.toUpperCase();
if(st3 == st2)
{
System.out.println("Equals");
}
else
System.out.println("Not Equals");
O/P for the above program displays as "Not Equals" where as i was expecting "Equals" Since "TEST" already exist in String Pool, st3 should have pointed to already existing String rather than creating a new String. Kindly explain the behavior. Thanks in advance