Java Data Type How to - Get thanks giving date for any year


We would like to know how to get thanks giving date for any year.


import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.Month;
import java.time.Year;
import java.time.temporal.TemporalAdjusters;
//  w  w  w. ja  v  a  2 s. c o  m
public class Main {

  public static void main(String[] args) {

  private static LocalDate thanksgiving(int year) {
    LocalDate thanksGiving = Year.of(year).atMonth(Month.NOVEMBER).atDay(1)
    return thanksGiving;

The code above generates the following result.