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