DecimalFormatSymbols equals() method in Java with Examples
The equals() method of java.text.DecimalFormatSymbols class in Java is used to check for equality of this DecimalFormatSymbols with the specified DecimalFormatSymbols. This method takes a DecimalFormatSymbols instance and compares it with this DecimalFormatSymbols and returns a boolean value representing the same.
Syntax:
public boolean equals(Object obj)
Parameter: This method accepts a parameter obj which is the DecimalFormatSymbols to be checked for equality with this DecimalFormatSymbols.
Return Value: This method returns an boolean which tells if this DecimalFormatSymbols is equal to the specified Object.
Exception: This method do not throw any Exception.
Program:
// Java program to demonstrate // the above method import java.text.*; import java.util.*; public class DecimalFormatSymbolsDemo { public static void main(String[] args) { DecimalFormatSymbols dfs1 = new DecimalFormatSymbols(); System.out.println("DecimalFormatSymbols 1: " + dfs1); DecimalFormatSymbols dfs2 = new DecimalFormatSymbols( new Locale("JAPANESE")); System.out.println("DecimalFormatSymbols 2: " + dfs2); DecimalFormatSymbols dfs3 = (DecimalFormatSymbols)dfs1.clone(); System.out.println("DecimalFormatSymbols 3: " + dfs3); System.out.println("Comparing DFS 1 and DFS 2: " + dfs1.equals(dfs2)); System.out.println("Comparing DFS 2 and DFS 3: " + dfs2.equals(dfs3)); System.out.println("Comparing DFS 1 and DFS 3: " + dfs1.equals(dfs3)); } } |
DecimalFormatSymbols 1: java.text.DecimalFormatSymbols@1073a DecimalFormatSymbols 2: java.text.DecimalFormatSymbols@1073a DecimalFormatSymbols 3: java.text.DecimalFormatSymbols@1073a Comparing DFS 1 and DFS 2: false Comparing DFS 2 and DFS 3: false Comparing DFS 1 and DFS 3: true
Recommended Posts:
- DecimalFormatSymbols getPatternSeparator() method in Java with Examples
- DecimalFormatSymbols clone() method in Java with Examples
- DecimalFormatSymbols setPatternSeparator() method in Java with Examples
- DecimalFormatSymbols getNaN() method in Java with Examples
- DecimalFormatSymbols getDigit() method in Java with Examples
- DecimalFormatSymbols getPerMill() method in Java with Examples
- DecimalFormatSymbols setDecimalSeparator() method in Java with Examples
- DecimalFormatSymbols setMonetaryDecimalSeparator() method in Java with Examples
- DecimalFormatSymbols getAvailableLocales() method in Java with Examples
- DecimalFormatSymbols hashCode() method in Java with Examples
- DecimalFormatSymbols getCurrencySymbol() method in Java with Examples
- DecimalFormatSymbols toString() method in Java with Examples
- DecimalFormatSymbols setInternationalCurrencySymbol() method in Java with Examples
- DecimalFormatSymbols setExponentSeparator() method in Java with Examples
- DecimalFormatSymbols getCurrency() method in Java with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


