When does A != A?

I have the following code to test for a unique node within my application:

GeneralNode    appNode = (GeneralNode)obj;
String sBottom     = appNode.getBottomLabel().getText();
System.err.println("sBottom = >"+sBottom+"<");
System.err.println("Result: "+ (sBottom == "ImSpecial"));

and I get the following output:

sBottom = >ImSpecial<
Result: false

Now this is happens only when I load a saved document using SVGReadDoc() otherwise it is fine.

I’m I missing something here or am I “special”???

dWiGhT

Ok… seems that I have stumbled onto a Java “gotcha”…

When I change the code to

sBottom.equals("ImSpecial")

it returns “Result: true”…

dWiGhT