The == operator returns true if both variables point to the same object.
When comparing strings this may or may not be the case. The JVM pools strings with the same value which sometimes causes == to return true.
To compare strings use the String.equals(String) method. java.lang.Object)" target="_blank" rel="nofollow">http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html#equals(java.lang.Object) [ August 20, 2006: Message edited by: Ben Souther ]
For non-ascii Strings, you should not use any of the above and instead use a Collator, which is found in the java.text package.
All Strings in Java are unicode strings. Collators are good for strings with Locale-specific characters. That has less todo with different technical encodings, but more with different sorting habits in different languages and cultures.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus