當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Java 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

相關用法


注:本文由純淨天空篩選整理自 java.time.Month.firstMonthOfQuarter() Method Example。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。