NumberFormat.getPercentInstance() has the following syntax.
public static final NumberFormat getPercentInstance()
In the following code shows how to use NumberFormat.getPercentInstance() method.
// w w w. jav a2 s .c om import java.text.NumberFormat; import java.util.Locale; public class Main { public static void main(String[] args) throws Exception { NumberFormat numberFormat = NumberFormat.getPercentInstance(); System.out.println(numberFormat.getMaximumFractionDigits()); } }
The code above generates the following result.