Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.time.Period;

public class Main {
    public static void main(String[] args) {
        Period p1 = Period.ofDays(15);
        System.out.println(p1);
        Period p2 = p1.plusDays(12);
        System.out.println(p2);
        Period p3 = p1.minusDays(12);
        System.out.println(p3);
        Period p4 = p1.negated();
        System.out.println(p4);
        Period p5 = p1.multipliedBy(3);
        System.out.println(p5);
    }
}