目录

boolean isLeapYear()

描述 (Description)

根据ISO符号日历系统规则, java.time.YearMonth.isLeapYear()方法检查年份是否为闰年。

声明 (Declaration)

以下是java.time.YearMonth.isLeapYear()方法的声明。

public boolean isLeapYear()

返回值 (Return Value)

如果年份是飞跃则为true,否则为false。

例子 (Example)

以下示例显示了java.time.YearMonth.isLeapYear()方法的用法。

package com.iowiki;
import java.time.YearMonth;
public class YearMonthDemo {
   public static void main(String[] args) {
      YearMonth date = YearMonth.of(2016,12);
      System.out.println(date.isLeapYear());  
   }
}

让我们编译并运行上面的程序,这将产生以下结果 -

true
↑回到顶部↑
WIKI教程 @2018