Question

This works fine:

TreeMap <String, ArrayList> x_probs_org = new TreeMap<String, ArrayList>();

But this:

TreeMap <String, TreeMap<String, Float>> x_probs = new <String, TreeMap<String, Float>>();

causes the following error:

error: <identifier> expected

Why? What am I doing wrong? I tried a couple of other ways but I don't see why this is wrong.

Was it helpful?

Solution

You forgot the TreeMap identifier:

.... = new TreeMap<String, TreeMap<String, Float>>();

OTHER TIPS

try it like that:

TreeMap <String, TreeMap<String, Float>> x_probs = new TreeMap<String, TreeMap<String, Float>>();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top