Java NumberFormat.parse(String source)

Syntax

NumberFormat.parse(String source) has the following syntax.

public Number parse(String source)  throws ParseException

Example

In the following code shows how to use NumberFormat.parse(String source) method.


import java.text.NumberFormat;
/*  ww  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.parse("123"));
  }
}




















Home »
  Java Tutorial »
    java.text »




DateFormat
DecimalFormat
NumberFormat
SimpleDateFormat