在Java 8中检查闰年
package com.shxt.demo02; import java.time.LocalDate; public class Demo14 { public static void main(String[] args) { LocalDate today = LocalDate.now(); if(today.isLeapYear()){ System.out.println("This year is Leap year"); }else { System.out.println("2018 is not a Leap year"); } } }
以上是怎样在Java 8中进行闰年的检查?的详细内容。更多信息请关注PHP中文网其他相关文章!