Praveen Kumar M K wrote:. . . basic datatypes like Integers and Strings . . .
Note - If you override equals method for a class, you need to override another default method called hashCode. Do read up more on this before you do the override.
Why are you calling Integer and
String basic? There is nothing basic about them, as if they were primitives.
Please don’t double-space code in the code tags, nor write line numbers, which are added automatically.
Beware of dates like 8 2 2012. If the month is 2, that counts as March in the Calendar class. I would have preferred to get a daysInMonth value from the switch block and use the random call once only.
And welcome to the Ranch