Properties int hashCode() method Example Program


Returns the hash code value for this Map as per the definition in the Map interface.

Program

package com.candidjava;

/* 
 * @author : Mohan 
 * @description : Returns the hash code value for this Map as per the definition in the Map interface.
 */
public class PropertiesHashCode {

	public static void main(String args[]) {
		String Str = new String("Welcome to candidjava.com");
		System.out.println("Hashcode for Str :" + Str.hashCode());
	}
}

Output

Hashcode for Str :959596107

Explanation

public int hashCode()
Returns the hash code value for this Map as per the definition in the Map interface.
Specified by:
hashCode in interface Map<K,V>
Overrides:
hashCode in class Object
Returns:
a hash code value for this object.
Since:
1.2
See Also:
Map.hashCode()


Related Post

Comments


©candidjava.com