Here you can find the source of is31DaysMonth(int month)
Verify if a given month has 31 days or not.
Parameter | Description |
---|---|
month | Month. |
public static final boolean is31DaysMonth(int month)
//package com.java2s; public class Main { /**//from w w w. j ava 2 s . co m * <p> * Verify if a given month has 31 days or not. * </p> * @param month Month. * @return Has 31 days or not. */ public static final boolean is31DaysMonth(int month) { int[] months31 = { 0, 2, 4, 6, 7, 9, 11 }; // for (int i = months31.length - 1; i >= 0; i--) { if (months31[i] == month) { return true; } } // return false; } }