Math.maxInt()

Signature

int maxInt (int a, int b)

Domain

action, condition

Description

Returns the greater of two int values. That is, the result is the argument closer to the value of Integer.MAX_VALUE. If the arguments have the same value, the result is that same value.

Parameters

NameTypeDescription
aintAn argument.
bintAnother argument.

Returns

TypeDescription
intThe larger of a and b.

Cautions

none

See Also

java.lang.Long#MAX_VALUE

Example


String result = String.valueOfInt (Math.maxInt (4, 29));

Result is: result contains: "29"