import java.io.FileReader; import java.io.IOException; /** * Really bad exception handling * So bad that the program will not compile. * Problem is that the IO exception thrown by doo (the throw is OK) * is not handled in any way by the calling function (main). * * Created: Jan 2022 * @author gtowell */ public class ExBad1 { /** * A function that opens a FileReader -- for no real reason * @param filename the name of the file to try to open * @throws IOException */ public void doo(String filename) throws IOException { FileReader bb = new FileReader(filename); } public static void main(String[] args) { ExBad1 ex1 = new ExBad1(); ex1.doo("20"); } }