How do I find end date of any given month in any year?

This example shows you how to find end date of any given month in a year.
package net.javaiq.examples.date;

import java.util.GregorianCalendar;


/**
 * This class demonstrates on how to find end date of any given month in a year 
 * @author JavaIQ.net
 * Creation Date Dec 3, 2010
 */
public class MonthEndDateCalculator {
    /**
     * calculates the last date of a month
     */
    public static java.sql.Date calculateMonthEndDate(int month, int year) {
        int[] daysInAMonth = { 29, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
        int day = daysInAMonth[month];
        boolean isLeapYear = new GregorianCalendar().isLeapYear(year);

        if (isLeapYear && month == 2) {
            day++;
        }

        GregorianCalendar gc = new GregorianCalendar(year, month - 1, day);

        java.sql.Date monthEndDate = new java.sql.Date(gc.getTime().getTime());

        return monthEndDate;
    }

    /**
     * Tests month end date calculation method with sample inputs
     * @param args
     */
    public static void main(String[] args) {
        int month = 2;
        int year = 2076;
        final java.sql.Date calculatedDate = calculateMonthEndDate(month, year);
        System.out.println("Calculated month end date : " + calculatedDate);
    }
}