posted 15 years ago
I don't think that program will compile as the type of s is not defined in main method. If we ignore that, the main method doesn't need to catch/declare in throws FileNotFoundException. You are calling doFileStuff of Slave class which doesn't declare any exceptions in its throws clause, so main method doesn't need to catch it. doFileStuff in Slave is a valid override of doFileStuff in Master, the overriding method can reduce the number of checked exceptions in the throws clause...