Class FieldPosition in Java

0
54
digitization, transformation, binary
Spread the love

Class FieldPosition in Java

FieldPosition objects are optionally passed to the format() methods of the Format class and its subclasses to return additional information about the formatting that has been performed.

The getBeginIndex() and getEndIndex() methods of this class are used to return the starting and ending character positions of some field of the formatted string. The integer value passed to the FieldPosition() constructor specifies what field of the returned string should have its bounds returned. The NumberFormat and DateFormat classes define various constants (which end with the string _FIELD) that can be used here. Typically, this bounds information is useful for aligning formatted strings in columns–for example, aligning the decimal points in a column of numbers.

The structure of the class FieldPosition is given by

public class java.text.FieldPosition extends java.lang.Object {
// Public Constructor
public FieldPosition(int field);
// Public Instance Methods
public int getBeginIndex();
public int getEndIndex();
public int getField();
}


Spread the love
READ  Error 1723 in Java? Here Are Steps How to Resolve.
I am the founder and owner of the blog - TechTravelHub.com, always love to share knowledge on test automation,tools,techniques and tips.I am a passionate coder of Java and VBScript.I also publish articles on Travel ideas and great honeymoon destinations.Apart from these, I am a gear-head,love to drive across India. I have shared lots of articles here on How to travel several parts of India.Customization of cars aka car modification is my another hobby.Get in touch with me on ani01104@gamil.com

LEAVE A REPLY

Please enter your comment!
Please enter your name here