Leap year java program

Leap year conditions:

if (year is not exactly divisible by 4) then (it is a common year)
else if (year is not exactly divisible by 100) then (it is a leap year)
else if (year is not exactly divisible by 400) then (it is a common year)
else (it is a leap year).

Program to Determine If Year Is Leap Year Java.

/**
 * Program to Determine If Year Is Leap Year Java Example.
 * @author javawithease
 */
public class LeapYearExample {	
 static void leapArea(int year){
  //Check Leap year condition.
  if((year % 400 == 0) || ((year % 4 == 0) && (year % 100 != 0))) {
	 System.out.println(year + ": Leap year.");
  }else{
	 System.out.println(year + ": Not a leap year.");
  }
 }	
 
 public static void main(String args[]){ 
  //method call 
  leapArea(2016); 
 }
}

Output:

2016: Leap year.

Download this example.