go to previous page   go to home page   go to next page

Answer:

A is less than B

How to use compareTo()

If you want to do A OP B where OP is one of < <= == != >= > do this:

A.compareTo( B ) OP 0

For example, you want A > B but > can't be used directly. So do this:

A.compareTo( B ) > 0

If you want A < B do this:

A.compareTo( B ) < 0

QUESTION 18:

How would you test if A != B ?


go to previous page   go to home page   go to next page