Basic ArrayLists 2

Create an ArrayList of Integers. Fill up the list with ten random numbers, each from 1 to 100. Then display the contents of the ArrayList on the screen.

You must use a loop to fill up the list. However, you may display it the easy way (no loop needed) like so:

System.out.println( "ArrayList: " + whateverYourArrayListVariableIsCalled );
ArrayList: [45, 87, 39, 32, 93, 86, 12, 44, 75, 50]

©2013 Graham Mitchell

This assignment is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.
Creative Commons License