-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
  • 714,442
  • 84
  • 1,110
  • 1,523

1 Answers1

0

You can simply type

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