Here is an example:
public MyDate() throws ParseException { SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy/MM/d\"); sdf.setLenient(false); St
Simply setting sdf.setLenient(false) will do the trick..
sdf.setLenient(false)