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

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -