A Comparator can be used to compare different objects / variables, and is a perfect thing for sorting (explained in a future article). Can be used like this:
Dim i As Integer Dim j As Integer i = 10 j = 2 Dim comparator As New BasicComparator() Print comparator.compare(i, j)
…which results in ”1”, because i is greater than j.