Hi,
I get a NullPointerException when I run this ...what am I doing wrong?
import java.util.*;
class HashMapDC{
private HashMap hmp;
public void HashMapDC(){ hmp = new HashMap();}
public void sethmp(String s1,String s2){
hmp.put(s1,s2);
}
}
public class TestHashMap{
public static void main(String args[]){
HashMapDC hmpdc = new HashMapDC();
hmpdc.sethmp("1","One");
}
}
thanks,
nims.
I get a NullPointerException when I run this ...what am I doing wrong?
import java.util.*;
class HashMapDC{
private HashMap hmp;
public void HashMapDC(){ hmp = new HashMap();}
public void sethmp(String s1,String s2){
hmp.put(s1,s2);
}
}
public class TestHashMap{
public static void main(String args[]){
HashMapDC hmpdc = new HashMapDC();
hmpdc.sethmp("1","One");
}
}
thanks,
nims.