java.time.Month.firstMonthOfQuarter() 方法示例



說明

**java.time.Month.firstMonthOfQuarter()** 方法獲取與此季度第一個月對應的月份。

宣告

以下是 **java.time.Month.firstMonthOfQuarter()** 方法的宣告。

public Month firstMonthOfQuarter()

返回值

與此月份對應的季度的第一個月份,不為 null。

示例

以下示例展示了 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
廣告
© . All rights reserved.