In the following program:
import java.util.*;
public class HashTableStringdouble
{
// private Hashtable<String, double[]> model = new Hashtable<String, double[]>();;
private Hashtable<String, double> model = new Hashtable<String, double>();; // this does not work
public static void main(String args[])
{
}
}
having double[] works but not double. It gives the following error:
HashTableStringdouble.java:7: error: unexpected type private Hashtable model = new Hashtable();; // this does not work ^ required: reference found: double HashTableStringdouble.java:7: error: unexpected type private Hashtable model = new Hashtable();; // this does not work ^ required: reference found: double 2 errors
I am not sure what am I doing wrong here. Please explain how does a Hashtable works.