src/edu/kit/informatik/calendar/Date.java
/**
     * Adds a given amount of months to the instance
     * Calendar rules are respected
     * @param months The amount of months to add
     * @return A new {@link Date} instance with the corresponding values
     */
Adds a given amount of months to the instance
Calendar rules are respected
@param months The amount of months to add
@return A new  Date instance with the corresponding values
Adds a given amount of months to the instance Calendar rules are respected @param months The amount of months to add @return A new Date instance with the corresponding values
public Date plusMonths(int months) {
        int totalMonths = months + this.month;
        if (totalMonths > 12) {
            totalMonths -= 13;
            return new Date(year, 1, 1).plusYears(1).plusMonths(totalMonths).plusDays(day - 1);
        } else {
            return new Date(year, totalMonths, 1).plusDays(day - 1);
        }
    }
public Date plusMonths ( int months ) { int totalMonths = months + this . month ; if ( totalMonths > 12 ) { totalMonths -= 13 ; return new Date ( year , 1 , 1 ) . plusYears ( 1 ) . plusMonths ( totalMonths ) . plusDays ( day - 1 ) ; } else { return new Date ( year , totalMonths , 1 ) . plusDays ( day - 1 ) ; } }
Adds a given amount of months to the instance
 Calendar rules are respected
 @param months The amount of months to add
 @return A new {@link Date} instance with the corresponding values
Adds a given amount of months to the instance Calendar rules are respected @param months The amount of months to add @return A new { @link Date } instance with the corresponding values
//true: the addition of months is more than 12 //false: otherwise