1

Any ideas why following line has the related error message? Thanks.

Code

Map<int,boolean> buffer = new HashMap<int, boolean>();

Error Message

Description Resource    Path    Location    Type
Syntax error, insert "Dimensions" to complete ReferenceType
Lin Ma
  • 9,059
  • 29
  • 91
  • 166

1 Answers1

5

Your code should be like this:

Map<Integer,Boolean> buffer = new HashMap<Integer, Boolean>();

You cannot use primitive types with genericity.

You will need to use Wrapper classes for them.

Yassin Hajaj
  • 20,892
  • 9
  • 46
  • 83
Pritam Banerjee
  • 16,584
  • 10
  • 80
  • 99