Month DECEMBER example
Description
Month DECEMBER
defines the singleton instance for
the month of December with 31 days.
This has the numeric value of 12.
Syntax
DECEMBER
has the following syntax.
public static final Month DECEMBER
Example
The following example shows how to use DECEMBER
.
import java.time.Month;
//from w w w.ja v a 2s . c om
public class Main {
public static void main(String[] args) {
Month m = Month.DECEMBER;
System.out.println(m.getValue());
System.out.println(m.name());
System.out.println(m.ordinal());
}
}
The code above generates the following result.