import java.util.*; public class ArrayListPrac { public static void main(String[] args) { practiceDie(); practiceStrings(); } public static void practiceStrings() { ArrayList names = new ArrayList(); String shortestWord; String longestWord; int lengthLongest, lengthShortest; names.add("hello"); names.add("goodbye"); names.add("how are you?"); names.add("!"); shortestWord = names.get(0); //initialize to first word in the ArrayList 'names' longestWord = names.get(0); //initialize to first word in the ArrayList 'names' lengthLongest = longestWord.length(); lengthShortest = shortestWord.length(); String word; for (int i=0; i lengthLongest) lengthLongest = word.length(); if ( word.length() < lengthShortest) lengthShortest = word.length(); } System.out.println("Longest word: " + lengthLongest); System.out.println("Shortest word: " + lengthShortest); } //end practiceStrings public static void practiceDie() { ArrayList dieList = new ArrayList(); //fill with some Die objects for (int i=0; i<20; i++) { dieList.add( new Die() ); } //output all of the die for (int i=0; i