[Solved]-Question 3 1 Point Exception Handling Technique Handling Problem States Gracefully Include Q37178210




this is advance java
Question 3 (1 point) Exception handling is a technique for handling problem states gracefully. These can include division by zero errors, parsing problems when a string’s data is not in the correct format to be conversted, and file IO problems such as file-not-found. a) True b) False Page 1: Question 4 (1 point) True:false: The code sample below is an illustration of exception handling. (Yes it is. Select true. This code sample is here just in case you need it to answer questions in the quiz.) public void openFile(String filename FileReader reader = null; try 10 11 reader new FileReader (filename); // our file is now open, so read from it int i-reader.read ) ) I/ end try catch (IOException e) // tell the user we could not open file system.out.println (“Could not open ” filename) / end catch finally // if we did get the file open // need to close it. if (readernull) try ( reader.close ) catch (IOException e) t system. out.println(“Error closing file”); system. out.println (“Done.”); ) I/ end finally a) True b) False Question 5 (4 points) This is a fill-in-the-blank question with four blanks. The four answers are (not in order): catch, finally, throw, try. Use the sample source code in the previous question if you need a remiğder of how try-catch- finally are used in code. (Note it doesn’t illustrate ‘throw’ check the book if you need to remind yourself what that does.) This keyword marks a block of program statements within which an exception might occur. This keyword indicates a block of program statements to be run if a particular sort of an exception is ‘caught: This keyword will generate an exception that will be passed to (ie ‘thrown’) out of the code block currently being executed. This keyword denotes a block of code that will be executed when the try block is fnished, whether an exception is caught, or not. Show transcribed image text Question 3 (1 point) Exception handling is a technique for handling problem states gracefully. These can include division by zero errors, parsing problems when a string’s data is not in the correct format to be conversted, and file IO problems such as file-not-found. a) True b) False
Page 1: Question 4 (1 point) True:false: The code sample below is an illustration of exception handling. (Yes it is. Select true. This code sample is here just in case you need it to answer questions in the quiz.) public void openFile(String filename FileReader reader = null; try 10 11 reader new FileReader (filename); // our file is now open, so read from it int i-reader.read ) ) I/ end try catch (IOException e) // tell the user we could not open file system.out.println (“Could not open ” filename) / end catch finally // if we did get the file open // need to close it. if (readernull) try ( reader.close ) catch (IOException e) t system. out.println(“Error closing file”); system. out.println (“Done.”); ) I/ end finally
a) True b) False
Question 5 (4 points) This is a fill-in-the-blank question with four blanks. The four answers are (not in order): catch, finally, throw, try. Use the sample source code in the previous question if you need a remiğder of how try-catch- finally are used in code. (Note it doesn’t illustrate ‘throw’ check the book if you need to remind yourself what that does.) This keyword marks a block of program statements within which an exception might occur. This keyword indicates a block of program statements to be run if a particular sort of an exception is ‘caught: This keyword will generate an exception that will be passed to (ie ‘thrown’) out of the code block currently being executed. This keyword denotes a block of code that will be executed when the try block is fnished, whether an exception is caught, or not.
Expert Answer
Answer to Question 3 (1 point) Exception handling is a technique for handling problem states gracefully. These can include divisio… . . .
OR

