class Book
{
//// FIELDS ////
private String longestWord;
private int wordCount;
private ArrayList<String> wordList = new ArrayList<String>();
/* Declare fields for the word list, the word count, and the longest word.*/
////// CONSTRUCTOR //////
//@param f -- the file object
public Book(File f)
{
wordList = readBook(f);
wordCount = countWords(wordList);
longestWord = findLongestWord(wordList);
}
public static String findLongestWord(ArrayList<String> b)
{
try
{
String longest = b.get(0);
}
catch (Exception f)
{
System.out.println("The longest word eludes me.");
}
return longestWord; Problem is HERE
}