ParsePosition setErrorIndex() method in Java with Example
The setErrorIndex() method of java.text.ParsePosition class is used to set the index at which parse error may occurr.
public void setErrorIndex(int ei)
Parameter: This method takes integer ei as a parameter at which parse error may occur.
Return Value: This method has nothing to return.
Below are the examples to illustrate the setErrorIndex() method:
index at which error occurred: 3
index at which error occurred: 3000
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.