here is code :
import java.util.*;
class abc
{
public static void main(String[] args)
{
Hashtable hm=new Hashtable();
for (int i=0;i<5;i++ )
{
hm.put("i","vipin"+String.valueOf(i));
System.out.println("Hello World!"+i+"\t"+hm.get("i"));
}
line-1System.out.println("Hello World!"+hm.get("i"));
line-2System.out.println("Hello World!"+hm.get("4"));
}
}
my question is i am using hashtable put and get methods for storing and retrieving values.i store values using "i" as integer variable in double quotes(b'cos method accept object)but when i retrieve values using variable "i" in line 1 it gives out put using i=4 but when i direct put the value of key i=4 as in line 2 it gives null value ?? why??