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

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -