Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package chapterfive;
- public class LeapYear
- {
- private int year;
- private boolean isLeapYear;
- public int GetYear(int number)
- {
- return number;
- }
- public boolean getIsLeapYear()
- {
- if(year > 1582)
- {
- if ((year % 4 == 0) && year % 100 != 0)
- {
- isLeapYear = true;
- }
- else if ((year % 4 == 0) && (year % 100 == 0) && (year % 400 == 0))
- {
- isLeapYear = true;
- }
- else
- {
- isLeapYear = false;
- }
- }
- return isLeapYear;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement