Skip to content

Instantly share code, notes, and snippets.

@Sankame
Last active August 14, 2017 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sankame/9fba3734d8c3c061215221ac8f81aaae to your computer and use it in GitHub Desktop.
Save Sankame/9fba3734d8c3c061215221ac8f81aaae to your computer and use it in GitHub Desktop.
List to String array
import java.util.List;
import java.util.ArrayList;
public class Main{
public static void main(String[] args) {
List<String> list = new ArrayList();
list.add("one");
list.add("two");
list.add("three");
String[] stringList = list.toArray( new String[ list.size() ] );
for (int i=0; i<stringList.length; i++) {
System.out.println( stringList[i] );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment