Question: JAVA Write a method named isLeapYear that takes a year (integer) as an argument and returns true if the specified integer is a leap year

JAVA

Write a method named isLeapYear that takes a year (integer) as an argument and returns true if the specified integer is a leap year and false otherwise.

Any year that is not evenly divisible by four is not a leap year. Every year that is evenly divisible by four is a leap year, unless it is also evenly divisible by 100. In this case, the year is not a leap year, unless the year is evenly divisible by 400 as well.

Try out your method with these examples.

Example

2015 ? false

2016 ? true

2000 ? true

3000 ? false

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!