DateFormatSymbols getMonths() Method in Java with Examples
The getMonths() Method of DateFormatSymbols class in Java is used to get the name of the months of the calendar in a string format.
public String getMonths()
Parameters: The method does not take any parameters.
Return Values: The method returns the name of the months in a string format.
Below programs illustrate the use of getMonths() method.
Month = January Month = February Month = March Month = April Month = May Month = June Month = July Month = August Month = September Month = October Month = November Month = December
Month 0 = January Month 1 = February Month 2 = March Month 3 = April Month 4 = May Month 5 = June