import java.time.LocalDate;
public class LocalDateExample1 {
public static void main(String[] args) {
LocalDate date = LocalDate.now();
LocalDate yesterday = date.minusDays(1);
LocalDate tomorrow = yesterday.plusDays(2);
System.out.println("Today date: "+date);
System.out.println("Yesterday date: "+yesterday);
System.out.println("Tomorrow date: "+tomorrow);
}
}
I'm trying to print the current date and add certain number of days to get new Date. I'm using eclipse ide to code and I cannot resolve LocalDate to a type.screenshot of my code