Java Map.Entry.hashCode()

Syntax

Map.Entry.hashCode() has the following syntax.

int hashCode()

Example

In the following code shows how to use Map.Entry.hashCode() method.


import java.util.Iterator;
import java.util.Map;
//from  w  w  w . j a v  a 2 s.c  o m
public class Main {
  public static void main(String args[]) {
    System.out.println("PATH = " + System.getenv("PATH"));

    Map<String,String> env = System.getenv();
    for (Iterator<Map.Entry<String,String>> it = env.entrySet().iterator(); it.hasNext();) {
      Map.Entry<String,String> entry = it.next();
      System.out.println(entry.hashCode());
    }
  }
}

The code above generates the following result.