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,739
  • 32
  • 105
  • 175

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
  • 21,337
  • 9
  • 51
  • 89
Pritam Banerjee
  • 17,953
  • 10
  • 93
  • 108