Here is an example:
public MyDate() throws ParseException { SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy/MM/d\"); sdf.setLenient(false); St
You can use the ParsePosition class or the sdf.setLenient(false) function
ParsePosition
sdf.setLenient(false)
Docs: http://docs.oracle.com/javase/7/docs/api/java/text/ParsePosition.html http://docs.oracle.com/javase/7/docs/api/java/text/DateFormat.html#setLenient(boolean)