Example usage for java.lang Byte hashCode

List of usage examples for java.lang Byte hashCode

Introduction

In this page you can find the example usage for java.lang Byte hashCode.

Prototype

@Override
public int hashCode() 

Source Link

Document

Returns a hash code for this Byte ; equal to the result of invoking intValue() .

Usage

From source file:Main.java

public static void main(String[] args) {
    Byte b1 = new Byte("100");
    Byte b2 = new Byte("-100");

    int i1 = b1.hashCode();
    int i2 = b2.hashCode();

    String str1 = "Hashcode of Byte " + b1 + " is " + i1;
    String str2 = "Hashcode of Byte " + b2 + " is " + i2;

    System.out.println(str1);/*from   w  w  w  .jav  a  2 s.  co m*/
    System.out.println(str2);
}