Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.time.Month;
import java.time.YearMonth;

public class Main {
    public static void main(String[] argv) {
        YearMonth currentYearMonth = YearMonth.now();
        System.out.printf("Days in month year %s: No of days: %s \n", currentYearMonth,
                currentYearMonth.lengthOfMonth());
        YearMonth creditCardExpiry = YearMonth.of(2018, Month.FEBRUARY);
        System.out.printf("Your credit card expires on %s: No of days: %s \n", creditCardExpiry,
                creditCardExpiry.lengthOfMonth());

    }
}