BlockingQueue<int>
Java Generics do not cover primitive types. You'll have to use Integer
instances.
This is an artifact of the type erasure approach taken by Java. You cannot erase an int
to an Object
and the actual bytecode needed to work with an int
is entirely different. That would only be possible if C++ approach was used to instantiate the template for each type parameter separately, as a new class with new bytecode.