The java.text.NumberFormat class in Java is part of the Java Internationalization framework and is used for formatting and parsing numbers. It provides localization support, allowing you to format numbers according to different locales. Here are some useful methods of the NumberFormat class:

Method Description
getInstance() Returns a default NumberFormat instance for the default locale.
getCurrencyInstance() Returns a NumberFormat instance for formatting and parsing currency values for the default locale.
getPercentInstance() Returns a NumberFormat instance for formatting and parsing percentages for the default locale.
getNumberInstance() Returns a NumberFormat instance for formatting and parsing numbers for the default locale.
getIntegerInstance() Returns a NumberFormat instance for formatting and parsing integers for the default locale.
format(double number) Formats a value into a string.
parse(String source) Parses the given string to produce a number. Throws ParseException if the string is not a valid number.
setMaximumFractionDigits(int newValue) Sets the maximum number of digits allowed in the fraction portion of a number.
setMaximumIntegerDigits(int newValue) Sets the maximum number of digits allowed in the integer portion of a number.
setMinimumFractionDigits(int newValue) Sets the minimum number of digits allowed in the fraction portion of a number.
setMinimumIntegerDigits(int newValue) Sets the minimum number of digits allowed in the integer portion of a number.