NumberFormat.parse(String source) has the following syntax.
public Number parse(String source) throws ParseException
In the following code shows how to use NumberFormat.parse(String source) method.
import java.text.NumberFormat; public class Main { public static void main(String[] args) throws Exception { NumberFormat numberFormat = NumberFormat.getNumberInstance(); System.out.println(numberFormat.parse("123")); } }
The code above generates the following result.