Home » Java Byte hashCode() Method

Java Byte hashCode() Method

by Online Tutorials Library

Java Byte hashCode() method

The hashCode() method of Java Byte class returns a hash code for this Byte.

Syntax:

Parameters:

The parameter ‘value’ represents a value whose hash code is to be determined.

Overrides

The hashCode() method overrides hashCode in class Object.

Return Value

This method returns a hash Code value for this Byte.

Example 1

Test it Now

Output:

Hash Value = 0  Hash Value = 12  Hash Value = -1  

Example 2

Test it Now

Output:

Hash Code = 123  

Example 3

Test it Now

Output:

Error:(7, 18) java: byte cannot be dereferenced  

Next TopicJava Byte

You may also like