See the example at this link
[To check leap year between two years](https://miniwebtool.com/leap-years-list/)

```
public class LeapYears {
   public static void main(String[] args) {

      GregorianCalendar cal = new GregorianCalendar();

      System.out.println("Leap years between 1975 and 2015:");
      for (int year = 1975; year < 2015; year++) {
         if (cal.isLeapYear(year)) {
            System.out.println(year);
         }
      }
   }
}

```