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

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -