Neocortex 🧠

Search

Search IconIcon to open search

Comparables and Comparators

Last updated Dec 14, 2021 Edit Source

In Java, there are two important interfaces, comparable and comparator.

# Comparable

A comparable is an interface with a generic. A class implementing it must also implement the compareTo function.

# Comparator

Comparators are classes that compare two objects.


Interactive Graph