in a tutorial (for implementing a xml parser) i saw the following code:
if( "NODENAME".equals(xmlreader.getNodeName()) ) { // getNodeName() returns java.lang.String
...
}
Is there a reason to write a string comparision like that?.
This may be some kind of best/bad practice or code like that could give some performance benefit. I would like to know if i should use this in commercial projects.