3:11 pm - Wednesday November 25, 8640

Hashtable Example program for rehash()

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</span>
*@Description:automatically increase the capacity of the hashtable
*/
import java.util.Hashtable;
public class ReHash1
{
public static void main(String args[])
{//rehash method is automatically called
Hashtable hs=new Hashtable(1);
hs.put("one",new Integer(1));
hs.put("two",new Integer(2));
hs.put("three",new Integer(3));
System.out.println("elements:"+hs);
}
}

Output:

elements:

{three=3,two=2,one=1}

BACK

Filed in: Z-A All Java Codes

Comments are closed.