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



描述

java.time.Month.minLength() 方法獲取本月天數最少值。

宣告

以下是 java.time.Month.minLength() 方法的宣告:

public int minLength()

返回值

本月天數最少值,28 到 31。

示例

以下示例展示瞭如何使用 java.time.Month.minLength() 方法。

package com.tutorialspoint;

import java.time.Month;

public class MonthDemo {
   public static void main(String[] args) {
 
      Month month = Month.FEBRUARY;
      System.out.println(month.minLength());  
   }
}

編譯並執行上述程式,將生成以下結果 −

28
廣告
© . All rights reserved.