Java NumberFormat .parseObject (String source, ParsePosition pos)

Syntax

NumberFormat.parseObject(String source, ParsePosition pos) has the following syntax.

public final Object parseObject(String source,   ParsePosition pos)

Example

In the following code shows how to use NumberFormat.parseObject(String source, ParsePosition pos) method.


import java.text.NumberFormat;
import java.text.ParsePosition;
/*from   w w w .ja v a 2 s . c o  m*/
public class Main {
  public static void main(String[] args) throws Exception {
    NumberFormat numberFormat = NumberFormat.getNumberInstance();
    System.out.println(numberFormat.parseObject("123",new ParsePosition(0)));
  }
}




















Home »
  Java Tutorial »
    java.text »




DateFormat
DecimalFormat
NumberFormat
SimpleDateFormat