I am making a program of a bowling tracker. I made four names and then I have to add specific dates they played and then the score they got on those days. Then print to screen the names, the number of games they played, average score, last games score and last game date. I need help with the Linked list I want to make. I could do the rest, i just need an example of how to use the LinkedList.
import java.lang.String;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
public class BowlingGame {
public static void main(String[] args)
{
String [] bowlingNames = {"Steve", "James", "Allen", "Tyson"};
ArrayList al = new ArrayList();
al.addAll(Arrays.asList(bowlingNames));
for (Iterator iter = al.iterator(); iter.hasNext(); )
{
String names = (String)iter.next();
System.out.println(names);
}
String [] gameDates = {"7 January, 11 Feburary 27 Feburary 9 March", "13 January, 1 Feburary, 3 March, 19 March", "1 January, 16 Feburary, 5 March, 18 March", "31 January, 23 Feburary 28 Feburary 10 March"};
LinkedList list = new LinkedList();
list.add(Lists.asList(gameDates));//Need help over here
for (Iterator iter = list.iterator(); iter.hasNext(); )
{
String dates = (String)iter.next();
System.out.println(dates);
}
}
}