Java Instant hashCode() method

The hashCode() method of Java Instant class is used to return a hash code for this instant.

Syntax

Parameters

No parameters.

Return

A random integer that is unique for each instance.

Example 1

Output:

The output will be like this.

1226468241

Example 2

Output:

The output will be like this.

1417601730
1417601730