Select four examples that initialize a NumberFormat reference using a factory.
A.
NumberFormat nf1 = new DecimalFormat();
B.
NumberFormat nf2 = new DecimalFormat(“0.00”) ;
C.
NumberFormat nf3 = NumberFormat.getInstance();
D.
NumberFormat nf4 = NumberFormat.getIntegerInstance();
E.
NumberFormat nf5= DecimalFormat.getNumberInstance ();
F.
NumberFormat nf6 = Number Format.getCurrecyInstance () ;
Explanation:
getInstance
public static finalNumberFormatgetInstance()
Returns the default number format for the current default locale. The default format is one of the styles provided by the other factory methods: getNumberInstance(E), getIntegerInstance(D), getCurrencyInstance(F)or getPercentInstance. Exactly which one is locale dependant.C: To obtain a NumberFormat for a specific locale, including the default locale, call one of NumberFormat’s factory methods, such as getInstance().
E:To obtain standard formats for a given locale, use the factory methods on NumberFormat such as getNumberInstance. These factories will return the most appropriate sub-class of NumberFormat for a given locale.
F:To obtain standard formats for a given locale, use the factory methods on NumberFormat such as getInstance or getCurrencyInstance.Reference:java.textClass NumberFormat
C D E F
C D E and F are correct