2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by trace63b
0

Using comparison

string1 > string2

is illegal in Java. To compare Strings You use compareTo method of String class:

string1.compareTo( string2 ) > 0

what would be in illegal way:

string1 > string2
0

Zibo,

Thanks, that fixed one of them. I should have realized that because I used the .equals right before it.

Tracy

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.