FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 7   



Following program shows you how to print present month.
We can get present month using LocalDate.now().getMonth() in java.

import java.time.LocalDate;
import java.time.Month;

public class Basic15 {

    public static void main(String[] args) {

        LocalDate presentDate = LocalDate.now();
        Month currentMonth = presentDate.getMonth();

        System.out.println("Present Month is: " + currentMonth);
    }

}

Output:

Present Month is: MARCH



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News