Home » Java Collection hashCode() Method with Examples

Java Collection hashCode() Method with Examples

by Online Tutorials Library

Java Collection hashCode() Method

The hashCode() method of Java Collection Interface returns the hash code value for this collection.

Syntax

Parameters

NA

Overrides

This method overrides hashCode in class Object

Return

The hashCode() method returns the hash code value for this collection.

Example 1

Test it Now

Output:

Hash Code : 8  

Example 2

Test it Now

Output:

Hash Code : 157560278  
Next TopicJava Collection

You may also like