java.time.Month.firstMonthOfQuarter() 方法
描述
java.time.Month.firstMonthOfQuarter() 方法获取本季度第一个月对应的月份。
声明
以下是 java.time.Month.firstMonthOfQuarter() 方法的声明。
public Month firstMonthOfQuarter()
返回值
本月对应的季度的第一个月,不为空。
示例
下面的例子展示了 java.time.Month.firstMonthOfQuarter() 方法的使用。
package com.tutorialspoint;
import java.time.Month;
public class MonthDemo {
public static void main(String[] args) {
Month month = Month.of(3);
System.out.println(month.firstMonthOfQuarter());
}
}
让我们编译并运行上面的程序,这将产生下面的结果 −
JANUARY

