FieldPosition toString() method in Java with Example
The toString() method of java.text.FieldPosition class is used to represent the field position object in the form of string.
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.
public String toString()
Parameter: This method does not accepts any argument as parameter.
Return Value: This method returns the string representation of this FieldPosition object.
Below are the examples to illustrate the toString() method:
FieldPosition :- java.text.FieldPosition[field=-1, attribute=java.text.MessageFormat$Field(message argument field), beginIndex=0, endIndex=0]
FieldPosition :- java.text.FieldPosition[field=-1, attribute=java.text.DateFormat$Field(am pm), beginIndex=0, endIndex=0]