best way to compare two strings in java?

which is the best way to compare two strings in java?
[60 byte] By [kothari_neerava] at [2007-11-27 1:12:15]
# 1
> which is the best way to compare two strings in java?What do you mean by compare two strings ?
TimTheEnchantora at 2007-7-11 23:47:35 > top of Java-index,Java Essentials,Java Programming...
# 2
The equals() method
PhHeina at 2007-7-11 23:47:35 > top of Java-index,Java Essentials,Java Programming...
# 3
What do you mean by "best" here"?Why don't you use String.equals()?
Michael.Nazarov@sun.coma at 2007-7-11 23:47:35 > top of Java-index,Java Essentials,Java Programming...
# 4
Hi, compareTo and compareToIgnoreCaseJack
jack@square6a at 2007-7-11 23:47:35 > top of Java-index,Java Essentials,Java Programming...
# 5
Without knowing the meaning of "best", I'd say:boolean b = aString.equals(anotherString);orboolean b =
prometheuzza at 2007-7-11 23:47:35 > top of Java-index,Java Essentials,Java Programming...
# 6
> compareTo and compareToIgnoreCase ^ best^ bestest
DrLaszloJamfa at 2007-7-11 23:47:35 > top of Java-index,Java Essentials,Java Programming...