ParsePosition getErrorIndex() method in Java with Example
The getErrorIndex() method of java.text.ParsePosition class is used to retrieve the index at which parse error may occur.
public int getErrorIndex()
Parameter: This method does not accepts any argument as a parameter.
Return Value: This method returns the index at which parse error may occur.
Below are the examples to illustrate the getErrorIndex() method:
index at which parse error may occur: 3
error index is not set
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.