/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package corejava;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.TreeSet;
import java.lang.Thread;
/**
*
* @author VijaykumarRamalingam
*/
public class hasmap {
public static void main(String args[])
{
//Hashmap vs Hashtable
//Synschrnized
//null key and null values
HashMap s=new HashMap();
s.put("1","b");
s.put(null, "5");
TreeSet sd=(TreeSet)s.keySet();
Iterator i= sd.iterator();
System.out.print(s.get(null));
Hashtable s3=new Hashtable();
s3.put(1,"b");
s3.put(1, null);
System.out.print(s3.get(1));
}
}
Sunday, November 15, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment