0
How will you get next tuesday using java8 in Java8?

Open 1 Answers 15 Views Education

How will you get next tuesday using java8 in Java8?

1 Answer

0

How will you get next tuesday using java8 in Java8?

Following code gets next tuesday using java8 -

//get the next tuesday

LocalDate today = LocalDate.now();

LocalDate nextTuesday = today.with(TemporalAdjusters.next(DayOfWeek.TUESDAY));

System.out.println("Next Tuesday on : " + nextTuesday);

by (52.6k points)
...