Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Java - Cannot instantiate the type...


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Schnozzinkobenstein   Members   -  Reputation: 152

Like
0Likes
Like

Posted 22 February 2010 - 01:15 PM

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.
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

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.

Sponsor:

#2 Sneftel   Senior Moderators   -  Reputation: 1781

Like
0Likes
Like

Posted 22 February 2010 - 01:32 PM

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.

#3 Schnozzinkobenstein   Members   -  Reputation: 152

Like
0Likes
Like

Posted 22 February 2010 - 02:39 PM

Yep. That's what it was. Thanks!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS