DecimalFormat hashCode() method in Java Last Updated : 01 Apr, 2019 Comments Improve Suggest changes Like Article Like Report The hashCode() method is a built-in method of the java.text.DecimalFomrat class in Java and is used to get an integral hashCode value for this DecimalFormat instance. Syntax: public int hashCode() Parameters: The function does not accepts any parameter. Return Value: The function returns an integral hashCode value. Below is the implementation of the above function: Program 1: Java // Java program to illustrate the // hashCode() method import java.text.DecimalFormat; import java.util.Currency; import java.util.Locale; public class Main { public static void main(String[] args) { // Create the DecimalFormat Instance DecimalFormat deciFormat = new DecimalFormat(); // Print the hashCode value System.out.println(deciFormat.hashCode()); } } Output: 423132 Program 2: Java // Java program to illustrate the // hashCode() method import java.text.DecimalFormat; import java.util.Currency; import java.util.Locale; import java.math.RoundingMode; public class Main { public static void main(String[] args) { // Create the DecimalFormat Instance DecimalFormat deciFormat = new DecimalFormat(); deciFormat.getInstance(Locale.US); // Print the hashCode Value System.out.println(deciFormat.hashCode()); } } Output: 423132 Reference: https://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html#hashCode() Create Quiz Comment G gopaldave Follow 0 Improve G gopaldave Follow 0 Improve Article Tags : Java Java-Functions Java-text package Java-DecimalFormat Explore Java BasicsIntroduction to Java3 min readJava Programming Basics9 min readJava Methods6 min readAccess Modifiers in Java4 min readArrays in Java7 min readJava Strings7 min readRegular Expressions in Java3 min readOOP & InterfacesClasses and Objects in Java5 min readAccess Modifiers in Java4 min readJava Constructors4 min readJava OOP(Object Oriented Programming) Concepts10 min readJava Packages2 min readJava Interface7 min readCollectionsCollections in Java12 min readCollections Class in Java13 min readCollection Interface in Java4 min readIterator in Java4 min readJava Comparator Interface5 min readException HandlingJava Exception Handling6 min readJava Try Catch Block4 min readJava final, finally and finalize4 min readChained Exceptions in Java3 min readNull Pointer Exception in Java5 min readException Handling with Method Overriding in Java4 min readJava AdvancedJava Multithreading Tutorial3 min readSynchronization in Java7 min readFile Handling in Java4 min readJava Method References7 min readJava 8 Stream Tutorial7 min readJava Networking6 min readJDBC Tutorial5 min readJava Memory Management3 min readGarbage Collection in Java6 min readMemory Leaks in Java3 min readPractice JavaJava Interview Questions and Answers1 min readJava Programs - Java Programming Examples7 min readJava Exercises - Basic to Advanced Java Practice Programs with Solutions5 min readJava Quiz1 min readJava Project Ideas For Beginners and Advanced15+ min read Like