Created
November 6, 2014 13:28
-
-
Save ornirus/d539baad20ea28d59f6a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Calendar | |
{ | |
private int[] monthDay = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; | |
private String[] monthName = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; | |
public boolean leapYear(int year) | |
{ | |
boolean ans = false; | |
if(year % 4 == 0) | |
{ | |
ans = true; | |
} | |
if(year % 100 == 0) | |
{ | |
ans = false; | |
} | |
if(year % 400 == 0) | |
{ | |
ans = true; | |
} | |
return ans; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment