Need a simple answer about Queues in Java -
i'm trying use arrayblockingqueue cant seem syntax right , dont know i'm supposed import use it. tried this:
blockingqueue<int> queue = new arrayblockingqueue<int>(100);
for declaration says there error int "dimensions expected after token" both of ints. feel simple solve, may have not imported correct thing or syntax off, appreciated. thanks
blockingqueue<int>
java generics not cover primitive types. you'll have use integer
instances.
this artifact of type erasure approach taken java. cannot erase int
object
, actual bytecode needed work int
entirely different. possible if c++ approach used instantiate template each type parameter separately, new class new bytecode.
Comments
Post a Comment