Jim Stevens wrote:I have done the searches.
I can't imagine what I can tell you that's not there. If you don't show what you tried or tell us what part you didn't understand. Here's an example, but I'm sure similar examples would have been readily available in the search results.
Also, note that unless you're writing your own sort method, you'll never call compareTo directly. If you call Collections.sort(), it calls compareTo() on various pairs of values.