Period hashCode()
returns a hash code for this period.
hashCode
has the following syntax.
public int hashCode()
The following example shows how to use hashCode
.
import java.time.Period; // w w w . j a v a2s .c o m public class Main { public static void main(String[] args) { Period p = Period.ofDays(12); System.out.println(p.hashCode()); } }
The code above generates the following result.