Example usage for java.lang Float hashCode

List of usage examples for java.lang Float hashCode

Introduction

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

Prototype

@Override
public int hashCode() 

Source Link

Document

Returns a hash code for this Float object.

Usage

From source file:Main.java

public static void main(String[] args) {
    Float f = new Float("25.57f");

    int retval = f.hashCode();
    System.out.println("Value = " + retval);
}

From source file:Main.java

public static int getHashCode(float[] p) {
    if (p == null) {
        return 0;
    }/*from   w ww .  jav  a2 s . c  o m*/
    int hash = 0;
    for (Float f : p) {
        hash ^= f.hashCode();
    }
    return hash;
}