We would like to know how to get the same day next year.
import java.time.LocalDate; //from ww w .ja va2 s . c o m public class Main { public static void main(String[] args) { LocalDate today = LocalDate.now(); LocalDate nextYear = today.plusYears(1); System.out.println(String.format("Today %s and next year %s", today, nextYear)); } }
The code above generates the following result.