Instead of:
NumberFormat fmt = new NumberFormat.getPercentInstance();
it should be:
NumberFormat fmt = NumberFormat.getPercentInstance();
because, you want to call the static method getPercentInstance from class NumberFormat
.
Furthermore (as Pshemo said), the NumberFormat
class is abstract, so you cannot instantiate it with the new
keyword.