Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.time.LocalDate;
import java.time.LocalDateTime;

public class Main {

    public static void main(String[] args) {
        LocalDate tomorrow = LocalDate.now().plusDays(1);
        System.out.println(tomorrow);

        LocalDate yesterday = LocalDate.now().minusDays(1);
        System.out.println(yesterday);

        LocalDate lastWeek = LocalDate.now().minusWeeks(1);
        System.out.println(lastWeek);

        LocalDate nextYear = LocalDate.now().plusYears(1);
        System.out.println(nextYear);

        LocalDateTime inThreeHoursAndTwentyMinutes = LocalDateTime.now().plusHours(3).plusMinutes(20);
        System.out.println(inThreeHoursAndTwentyMinutes);
    }
}