Skip to content

Glossary: Java Beyond the Basics

Comparable

Also written: compareTo

An interface giving a type its natural order through compareTo, which returns negative, zero or positive. Strings and numbers implement it.

Where the book teaches it

Related terms

ComparatorBounded type