james kinyua wrote:
the output is
java.text.ParseException: Unparseable date: ""
at java.text.DateFormat.parse(DateFormat.java:366)
The error message is saying that it is trying to parse a blank
string. So, this is not an issue of parsing incorrectly. This is an issue of getting the wrong input. Most likely, you type an extra return (or had an extra return from previous input).
Regardless, your best action to resolve this is probably to read again until you get an actual string that you can parse. And even so, what if the user enters an invalid string? Are applications supposed to be breakable by user input?
Henry