Example of Hash Table

We write here a program which is example of Hash Table.

package com.javaforecast4u;
import java.util.*;
public class ExampleHashtable {

    /**
     * @author:arbind;
     */
    public static void main(String[] args) {
        
         Hashtable ht=new Hashtable();
         ht.put("empid","1009");
         ht.put("empname","arbind");
         ht.put("email","arbind@gmail.com");
         ht.put("Mobile","9898989898");
         System.out.println(ht);
         ht.put("Mobile","1111888");
         ht.put(new Integer(99),"abc");
         System.out.println(ht);
        
    }
}

1 comment :