Online Java Compiler By
JavaTpoint.com
import java.util.Collection; import java.util.concurrent.ConcurrentLinkedQueue; public class JavaCollectionToArrayExample3 { public static void main(String[] args) { Collection
collection= new ConcurrentLinkedQueue(); System.out.println("List of even numbers in our collection."); for (int i=1;i<=10;i++) { collection.add(i); } Integer[] a = new Integer[5]; Integer[] b = collection.toArray(a); for (int i = 0; i
Output