Java TreeMap within TreeMap - Identifier error?
Pergunta
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.
Solução
You forgot the TreeMap
identifier:
.... = new TreeMap<String, TreeMap<String, Float>>();
Outras dicas
try it like that:
TreeMap <String, TreeMap<String, Float>> x_probs = new TreeMap<String, TreeMap<String, Float>>();
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow