[Poll] Date class and method for getting Date after X months.
I'm writing a Date class in Java and I want it to have a method with which you can take an other Date object that corresponds to the date after a number of months. For example "Date dateB = dateA.dateAfterMonths(10);" will result in dateB having the date ten months after dateA's date. The problem is that months don't have the same number of days (as we all know). So, if the date is January 13 and I ask "What the date will be one month from now?" the most expected answer will probably be February 13, but if it is January 31 (or 30, or 29) and I ask the same question what answer would you expect? February 28 (the last day of the next month) or perhaps March 2 (30 days later). The first option gives a more intuitive answer, but lacks consistency. The second option is consistent, but if we assume that each month has on average 30 days then we lose 5 days every year (30 x 12 = 360), and the expression "Date dateB = dateA.dateAfterMonths(60);" will be off for over a whole month. What do you think? TL;DR: The date is January 31 and you are asked "What the date will be, one month from now?", would you answer February 28 (the last day of the next month) or March 2 (30 days later). You can find my Date class here: https://code.sololearn.com/c3LWL1AsWKM0/#java