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