CollationElementIterator setOffset() method in Java with Examples
The setOffset() method of java.text.CollationElementIterator class is used to set the cursor of the iterator to the particular index passed as parameter.
public void setOffset(int newOffset)
Parameter: This method takes an integer value newOffset at which point the cursor has to be set.
Return Value: This method has nothing to return.
Below are the examples to illustrate the setOffset() method:
current offset is 4
current offset is 0
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.