/* * Intro to Programming CSE 1310 * University of Texas at Arlington */ package code3may18; import java.util.ArrayList; /** * * @author jcmtiernan */ public class Code3May18 { /** * @param args the command line arguments */ public static void main(String[] args) { final int RSIZE = 20; ArrayList rNums = new ArrayList(RSIZE); rNums.add(50); rNums.add(22); rNums.add(0,129); System.out.println("ArrayList rNum has "+rNums); System.out.println("ArrayList rNum at index 2 has "+rNums.get(2)); for (int j = 0; j < 20; j++) { rNums.add((int)(Math.random() * 100)); } System.out.println("ArrayList rNum has "+rNums); } }