-1

I want to store a list of triad and my syntax is:

Map<Integer, Map<Integer, Integer> > map;

map = new HashMap<Integer, TreeMap<Integer, Integer> >();

Then Java said:

Type mismatch: cannot convert from HashMap<Integer,TreeMap<Integer,Integer>> to Map<Integer, Map<Integer,Integer>>

What could I do?

Sergey Kalinichenko
  • 697,062
  • 78
  • 1,055
  • 1,465

1 Answers1

0

You can simply type

map = new HashMap<>();
Patrick
  • 821
  • 11
  • 25