Kotlinlearncs.online LogoJava
Return to List

Solve: Comparable Min

Created By: Geoffrey Challen
/ Version: 2020.10.0

Create a public class named Min with a single class method named min. min should accept an array of Objects that implement Comparable and return the minimum. If the array is null or empty, you should return null.

As a reminder, compareTo returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Related Lessons

Stuck? You may find these lessons helpful: