is Leap Year - Android java.util

Android examples for java.util:Year

Description

is Leap Year

Demo Code

import android.text.TextUtils;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class Main{

    public static boolean isLeapYear(int year) {
        if ((year % 4 == 0 && year % 400 != 0) || year % 400 == 0) {
            return true;
        } else {/*from   w  w  w  .  j  a va 2s .c o  m*/
            return false;
        }
    }

}

Related Tutorials