June 2018
Beginner
722 pages
18h 47m
English
If there is a collection that can be used as the source for the array values, it has the method toArray(), which can be called as follows:
List<Integer> list = List.of(0, 1, 2, 3);Integer[] arr1 = list.toArray(new Integer[list.size()]);System.out.println(Arrays.toString(arr1)); //prints: [0, 1, 2, 3]
Read now
Unlock full access