1

I'm trying to create a HashSet of type byte in my class, like so:

public HashSet<byte> transparent;

But the eclipse error message shows:

Syntax error, insert "Dimensions" to complete ReferenceType

I don't know what this is, or what it means! I am a bit of a coding newbie, especially for java 8. I am not even sure if that's the problem!

3
  • May have actually just been a bug. I tried creating the same line a different way, with no errors. Commented Dec 25, 2014 at 1:34
  • Generic type parameters cannot be primitives. Commented Dec 25, 2014 at 1:36
  • use Byte Object instead of a primitive byte eg. public HashSet<Byte> transparent; Commented Dec 25, 2014 at 1:38

1 Answer 1

1

You have to use the byte wrapper class Byte. Generics cannot use primitive types

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.