Skip to content
Reference > Methods

maximum(o)

Definition

Comparable maximum(Comparable ... o)

Description

Finds and returns the maximum value, skipping nulls. Returns null if all arguments are null. Note the return type will be the widest of input values.

Parameter Definition

Name Type Description
o Comparable... values to compare

Examples

1
2
3
String r1 = maximum("orange","bananna",null,"apple"); // r1 == orange
Object r2 = maximum(null,null,null); // r2 == null
String r3 = maximum("1","1.7","-1"); // r3 == 1.7