hashCode Method
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

List.hashCode Method

Visual Studio 2005

Retrieves the hash code of a List.object.

Package: java.util

Assembly: vjslib (in vjslib.dll)

public abstract int hashCode();

An integer representing the hash code of the List object.

In this example, you display the hash code of a linked list object after adding some elements to it.

// list-getHash1.jsl
// List.GetHashCode example

import java.util.*;

public class MyClass
    public static void main(String[] args)
        // Create a linked list object:
        LinkedList lList =  new LinkedList();

        // Add some elements:
        lList.add(new Double(5.25));
        lList.add(new Byte((byte)127));
        lList.add(new Integer(55));

        // Print the hash code:
        System.out.println("The hash code is: " + lList.GetHashCode());

The hash code is: -1898639464
© 2015 Microsoft