Monthly Archives: January 2012

Java: Converting a List to an Array

For some reason, I always keep forgetting how to do this, without using a for-loop. import java.util.ArrayList;  import java.util.List; public class ConvertListToArray { public static void main(String[] args) { ArrayList list = new ArrayList(); list.add(“test1”); list.add(“test2”); list.add(“test3”); String[] arrayOfStrings = … Continue reading

Posted in code example, java | Leave a comment