Class ParsePosition in Java

0
24
Spread the love
  • 23
  • 34
  • 56
  • 35
  •  
  •  
  •  
  • 12
  •  
  •  
    160
    Shares

Class ParsePosition in Java

Perseposition objects are passed to the parse() and parseObject() methods of Format and are subclasses. The ParsePosition class represents the position in a string at which parsing should begin or at which parsing stopped. Before calling a parse() method, we can specify the starting position of parsing bypassing the desired index to the ParsePosition() constructor, or by calling the setIndex() of an existing ParsePosition object.

When parse() returns, we can determine where parsing ended by calling getIndex(). When parsing multiple objects or values from a string, a single ParsePosition object can be used sequentially.

The Class Structure of the ObjectOutputStream is given as

public class java.text.ParsePosition extends java.lang.Object{
// Public Constructor
public ParsePosition (int index);
// Public Instance Methods
public int getIndex ();
public void setIndex (int index);
Don't miss out!
Subscribe To Newsletter

Receive top technical news, lesson ideas, travel tips and more!

Invalid email address
Give it a try. You can unsubscribe at any time.

Spread the love
  • 23
  • 34
  • 56
  • 35
  •  
  •  
  •  
  • 12
  •  
  •  
    160
    Shares

LEAVE A REPLY

Please enter your comment!
Please enter your name here