Java List hashCode() MethodThe hashCode() method of List interface returns the hash code value for this list. SyntaxParametersNA Specified Byhashcode in interface Collection<E> OverridesThis method overrides hashCode in class Object ReturnsThe hashCode() method returns the hash code value for this list. Example 1Test it NowOutput: Hash Code for 5 : 5 Hash Code for 51 : 51 Hash Code for 52 : 52 Example 2Test it NowOutput: Hash Code : -1772261557 Example 3Test it NowOutput: Exception in thread "main" java.lang.NullPointerException at com.javaTpoint.JavaListHashCodeExample3.main(JavaListHashCodeExample3.java:12) Next TopicJava List |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India