Say I make capacity of arrayBlockingQueue and linkedBlockingQueue both to 100. I add only 10 elements in each of them.
Will array hold full capacity even though 90 elements are empty? I mean would it have 10 elements and 90 nulls?
Another thing, how would linked behave in this case? Would it have 10 or 100 nodes? And would there be 90 'null value nodes'?
Can someone explain me this? How do they behave in this case?
ArrayBlockingQueueit will create an array of size 100 and 10 elements, rest will nulls. In case ofLinkedBlockingQueueonly 10 nodes will be created - the capacity here is used as a limitation to create so called bounded queue with maximum entries limit.