java- leap year judgment GregorianCalendar

 
package com.rj.bd.new_one;

import java.util.GregorianCalendar;
/**
 * @desc  闰年的判断
 * @time 2019-09-08
 * @author yhx
 *
 */
public class RunNina {

    public static void main(String[] args) {
        int year = 2020;
        GregorianCalendar gc = new GregorianCalendar();
        boolean result = gc.isLeapYear(year);
        System.out.println(result);
    }

}

 

Guess you like

Origin www.cnblogs.com/yhx0921/p/11487565.html