Close

Java Utils - Objects.hashCode() Examples

Java Utils Java Java API 


Class:

java.util.Objects

java.lang.Objectjava.lang.Objectjava.util.Objectsjava.util.ObjectsLogicBig

Method:

public static int hashCode(Object o)

Returns the hash code of a non-null argument and 0 for a null argument


Examples


package com.logicbig.example.objects;

import java.util.Objects;

public class HashCodeExample {

public static void main(String... args) {
String str = "testString";
int i = Objects.hashCode(str);
System.out.println(i);
}
}

Output

1727748931




See Also