class Word{ String word; int totFreq = 0; int nConnects = 1; public Word(){ } //this is called when a word is encountered need to check public void addWordInstance(){ totFreq++; if(totFreq > maxFrequency){ maxFrequency = totFreq; } } }