Created
October 25, 2017 19:27
-
-
Save ajbinky/3af542177f71c7ee684c967db8b62f99 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package arrays; | |
import java.util.ArrayList; | |
import java.util.Random; | |
public class ArrayLists { | |
public static void main(String[] args) { | |
ArrayList<Integer> list = new ArrayList<>(); | |
Random randy = new Random(); | |
System.out.println("arraylist size: " + list.size()); | |
for (int i = 0; i < 1000000; i++) { | |
list.add(randy.nextInt()); | |
} | |
System.out.println("arraylist size: " + list.size()); | |
for (int i = 0; i < 1000000; i++) { | |
System.out.println(list.get(i)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment