Thanks for your replies, that works fine. My program now compiles but I have an issue when adding things to the list (siteList). My program basically reads in a line from a file and then splits it into tokens and stores these in an array temporarily. The values in this array (lineContents) are then written to an object constructor of type site. However, when doing this using the code below, I get a Null Pointer Exception. Let me know your thoughts.
List siteList;
while ((line = in.readLine()) != null){ //whilst there are lines in the file
StringTokenizer st = new StringTokenizer(line, ",");
while (st.hasMoreTokens()) {
lineContents[tokenCount] = st.nextToken();
tokenCount = tokenCount + 1;
}
//add to the sites
siteList.add(new site(lineContents[0],lineContents[1]));
}