Home » Java Programming » Exceptions

Given that all methods of class FileOutputStream, including close(), throw an IOException, which of these is true? import java.io.*; public class MyProgram { public static void main(String args[]) { FileOutputStream out = null; try { out = new FileOutputStream("test.txt"); out.write(122); } catch(IOException io) { System.out.println("IO Error."); } finally { out.close(); } } }

← Previous Next →

Discussion & Comments

No comments yet. Be the first to comment!