How to validate Date object in Java
问题 Can any one tell me solution for the following: I have a Util.Date object in java.I want to validate the date entered. I am parsing the date object using the required format. For ex, Format is "MM/dd/yyyy" and Date entered is "23/12/2010" For this date, I am not getting any Parse Exception but the date is adjusted to "11/12/2011" which should not happen in my case.Instead I want to throw error message. Please help me in this asap. Thanks in advance 回答1: In DateFormat class you have to reset