Java Date Time - MonthDay hashCode() example








MonthDay hashCode() returns a hash code for this month-day.

Syntax

hashCode has the following syntax.

public int hashCode()

Example

The following example shows how to use hashCode.

import java.time.MonthDay;
//  www .  jav  a 2s .  co  m
public class Main {
  public static void main(String[] args) {
    MonthDay m = MonthDay.now();
    
    System.out.println(m.hashCode());

  }
}

The code above generates the following result.