Month firstMonthOfQuarter() method in Java
The firstMonthOfQuarter() is a built-in method of the Month ENUM which is used to get the first month corresponding to this quarter. The quarter is defined by dividing the year into 4 groups as:
- Group 1: JANUARY, FEBRUARY, MARCH
- Group 2: APRIL, MAY, JUNE
- Group 3: JULY, AUGUST, SEPTEMBER
- Group 4: OCTOBER, NOVEMBER, DECEMBER
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.
public int firstMonthOfQuarter()
Parameters: This method does not accepts any parameters.
Return Value: This method returns the month corresponding to the first month of this quarter.
Below programs illustrate the above method: