convert integer arraylist to array java

Solutions on MaxInterview for convert integer arraylist to array java by the best coders in the world

showing results for - "convert integer arraylist to array java"
Samuel
25 Jan 2021
1//only works in java 8 or later
2list.stream().mapToInt(i -> i).toArray();
Dinah
07 Jun 2017
1ArrayList<String> ArrayLister=new ArrayList<>(){ArrayLister.add("Hi")};
2String[] array=ArrayLister.toArray(String[]);
3
Nate
07 Jul 2016
1Your_ArrayList_Name.stream().mapToInt(k->k).toArray();
similar questions
queries leading to this page
convert integer arraylist to array java