javaparseexception

Is ParseException only thrown for conversion from string to date?


I'm trying to become clear about ParseException. Its example focus is "convert from string to date", and I also found:

This is a checked exception and it can occur when you fail to parse a String that is ought to have a special format.

But I cannot find any example for another case!!!

So can you help me clear this case? Any another case that uses ParseException?


Solution

  • The definition of Parse exception according to JAVA

    Signals that an error has been reached unexpectedly while parsing

    As it clearly says, it throws an error while parsing
    Edited
    So parse use cases would be the following
    Converting from String to date, String to any other format,pattern matcher,Object parsing to custom Objects etc...

    You can refer here for any examples..... http://www.javased.com/index.php?api=java.text.ParseException