Java Format - Java NumberFormat.equals(Object obj)








Syntax

NumberFormat.equals(Object obj) has the following syntax.

public boolean equals(Object obj)

Example

In the following code shows how to use NumberFormat.equals(Object obj) method.

/*www .  ja  v a  2s .  com*/
import java.text.NumberFormat;

public class Main {
  public static void main(String[] args) throws Exception {
    NumberFormat numberFormat = NumberFormat.getPercentInstance();
    System.out.println(numberFormat.equals(NumberFormat.getPercentInstance()));
    
    
  }
}

The code above generates the following result.