Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.ConcurrentLinkedQueue; public class ConcurrentLinkedQueueSizeExample3 { public static void main(String[] args) { ConcurrentLinkedQueue
queue = new ConcurrentLinkedQueue
(); queue.add(null); queue.add(null); int val =queue.size(); System.out.println("Size of queue = "+val); } }
Output