Check if a String is a valid date



This example checks if a String is a valid date by parsing the String with an instance
of the SimpleDateFormat class and returns true or false.

The output will be…


true
false

…since the year 2004 was a leap year.







Search for more Java info on this site here:
Custom Search


Any thoughts or questions?