I am doing an assignment and it involves using the GregorianCalendar. The specs say I need to use setLenient(false); how do I do this? I also need to set a constant date (1/1/2009) so that the first day of my program is always that.
It also says to access the day, month and year through this:
get(1) //returns the year
get(2) // returns the month
get(5) /// returns the day
To add n days to the date, call the add method with a field number of 5: add(5, n);
To subtract: add(5, -n);
Can someone please explain what that means and how to implement it?