Class DecimalFormat in Java

Class DecimalFormat in Java: DecimalFormat class is a subclass of Format class mostly used by NumberFormat…