what the heck?
why can't i use == to test for equality between strings with java?
example:
Code:
String myState="CA";
String states = new String[] { "CA","AZ" };
if( states[0]==myState )
{
// this will always fail
}
if( states[0].equals(myState) )
{
// this is true
}
i this was mentioned before, but i want to now precisely why.. or is there no good answer?