Android examples for java.util:Year
is Leap Year
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; } } }