ArrayList list=new ArrayList<>();
Create templates to quickly answer FAQs or store snippets for re-use.
Isn't it more performant to use the buildin method toArray(). So the code would be:
List<String> list = new ArrayList<>();
// add some data
String starr = list.toArray(new String);
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.