java - Trying to set a GregorianCalendar variable = to another GregroianCalendar variable + 4 years -
i having through getting setting value of gregoriancalendar of 1 + 4 years. see there s add method in class accepts int , trying pass gregoriancalendar type.
public gregoriancalendar getenrollmentdate(gregoriancalendar enrollmentdate){ return enrollmentdate; } public void setprojectedgraduationdate(gregoriancalendar projectedgraduationdate){ calendar cal = new gregoriancalendar(); cal.settime(this.enrollmentdate); projectedgraduationdate = cal.add(calendar.year, 4); }
the value trying add years "enrollmentdate"
is possible, "settime" method accepts "date" time, not gregoriancalendar though.
public setprojectedgraduationdate(gregoriancalendar projectedgraduationdate){ projectedgraduationdate.settime(this.enrollmentdate); projectedgraduationdate.add(calendar.year, 4); }
Comments
Post a Comment