Example usage for java.lang Boolean hashCode

List of usage examples for java.lang Boolean hashCode

Introduction

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

Prototype

@Override
public int hashCode() 

Source Link

Document

Returns a hash code for this Boolean object.

Usage

From source file:Main.java

public static void main(String[] args) {
    Boolean b1 = new Boolean(true);
    Boolean b2 = new Boolean(false);

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

    System.out.println("Hash code of " + b1 + " is " + i1);
    System.out.println("Hash code of " + b2 + " is " + i2);
}