HashTable Example

import java.util.Collection;
import java.util.*;
public class HashTableDemo1 
{
	public static void main(String[] args) 
	{
	 Hashtable ht = new Hashtable();
	    ht.put("1", "One");
	    ht.put("2", "Two");
	    ht.put("3", "Three");
	    Collection c = ht.values();
	    Iterator itr = c.iterator();
	    while (itr.hasNext()){
	      System.out.println(itr.next());
	    }
	    c.remove("One");
	    Enumeration e = ht.elements();
	    while (e.hasMoreElements()){
	      System.out.println(e.nextElement());
	    }
	}
}

Download

Collections in Java

ArrayList Example
HashMap Example
HashTable Example
Array Sort
Read Properties File
Get System Properties


Write your Comment

Name :
Email Id : [ We will not publish your email id ]
Your Comment : [ Maximum 200 chars ]
Enter Security code