Start Validating a date in java

Validating a date in java

, objects and a set of well defined interfaces to that data.

Never use strings, when something better is available.

Object oriented programming organizes a program around its data, i.e.

However, I'm strongly against rejecting five or more digits, as that essentially puts an expiration date on your code.

“29/2/2007”, “29/02/2007” – 2007 is not leap year, only has 28 days 4.

I'm looking to increase the conciseness of this code.

I realize that I can use Joda (or Java 8's new date API), but if I were to keep this to just Java 7, any suggestions?

What happens if someone provides a five digit year?