Greg Charles wrote:The problem is <= should be <
args[args.length] is always going to cause an out-of-bounds exception no matter how many args there actually are. In Java (as in C and C++) arrays are indexed from 0 to length - 1.
Rob Prime wrote:What happens if --day becomes 0, or ++day overflows to the next year (366 / 367)?
instead of using Calendar.setTimeInMillis(long) works great also.
Rob Prime wrote:Use cal.add(Calendar.DAY_OF_YEAR, -1) and cal.add(Calendar.DAY_OF_YEAR, 1) instead of setting the day of year.
Jeanne Boyarsky wrote:It's not like what you do at first will be what you have to do forever.
with the multiple-choice/multiple-answers questions, all the correct statements must be selected and none of the wrong ones -- otherwise you simply get no credit at all.