My client code:
public static void inputFiles()
{
File inputFile = new File("colors2.txt");
if (!inputFile.exists()) {
throw new FileNotFoundException(("File not found"));
}
ColorSet colorSetter = new ColorSet(inputFile);
}
My Supplier class constructor:
public ColorSet(File source) throws FileNotFoundException
{
if (!source.exists()) {
throw new FileNotFoundException(("File not found"));
}
colorInput = source;
}
I keep on getting "unreported exception java.io FileNotFoundException; must be caught or declared to be thrown"
I've try catching it in the client method, but it's telling me it can't be called in the body block, maybe I'm doing it wrong?