2:44 am - Friday April 19, 2019

Hashtable Example program for hashCode()

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044
/**
Author :candidjava.com
Description: Returns the hash code value for this Map as per the definition in the Map interface..
 */
import java.util.*;
import java.util.Hashtable;
import java.io.IOException;

public class HashtableHashcodeExample {
	public static void main(String args[]) throws IOException {
		int i;
		int s = 45;
		Hashtable h = new Hashtable();
		h.put(1, s);
		i = h.hashCode(); // returns the hashcode value for the given value
		System.out.println(i);
	}
}

Output
44

Filed in: Z-A All Java Codes

Comments are closed.