Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import static java.time.temporal.ChronoUnit.DAYS;

import java.time.LocalDate;

public class Main {
    public static void main(String[] argv) {
        LocalDate today = LocalDate.now();
        LocalDate tomorrow = today.plusDays(1);
        LocalDate yesterday = today.minus(1, DAYS);

        if (tomorrow.isAfter(today)) {
            System.out.println("Tomorrow comes after today");
        }

        if (yesterday.isBefore(today)) {
            System.out.println("Yesterday is day before today");
        }
    }
}