Java Double isFinite() method

The isFinite() method of Java Double class returns true if the argument passed is a finite floating-point number, otherwise returns false(in case of NaN and infinity arguments).

Syntax

Parameters

d- This is the double-precision number to be tested.

Return value

The isFinite() method returns true when finite floating-point value is passed as argument, otherwise returns false.

Example 1

Output:

Value returned is : false

Example 2

Output:

Returned result = true
Returned result = true
Returned result = false
Returned result = false