import java.io.BufferedReader;
import java.util.Collections;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader
For the first issue, the problem is fairly simple. oneName
is a String
, and myCelebrityList
is a collection of CelebrityNamesFile
- which means that you can only add objects to the collection of type CelebrityNamesFile
.
For the second issue, your problem is that the CelebrityNamesFile
class does not implement the Comparable
interface. Sorting requires that an ordering is implemented for the list element type, e.g. by implementing Comparable
for the class or providing a Comparator
to the sort
.