package main;
import java.util.LinkedList;
import java.util.Map;
public class Main {
private Map<String, LinkedList<String>> a;
private int MAX_SIZE;
public void main(String[] args) {
a=new Map<String, LinkedList<String>>();
...
...
bla bla bla
Java - Cannot instantiate the type...
There is probably some data structure that I could be using that would be better than this, but nothing is coming to mind. But anyway, I'm getting this error: "Cannot instantiate the type Map<String,LinkedList<String>>" and I'm not sure why.
The abominatin of a data structure that I have created is being used to store a combination of both Strings and Doubles in a hash table that needs to be able to store the Doubles in order at each key along with an identifier for that value (each one has an identifier). For example, I might store "AX" and the value 1.42 at hash key "A" as "AX1.42" along with "2.999" and "MD6.705". The MD would need to be inserted before the AX, as it is a larger value.
Map is an interface, not a class. It describes how mappings behave, but is not itself an implementation of a mapping. It sounds like you might want a HashMap.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement