Question 16 1 pts Which class can be used to implement a file dialog box in a program with a graphical user interface? J
Posted: Sun May 15, 2022 1:51 pm
Question 16 1 pts Which class can be used to implement a file dialog box in a program with a graphical user interface? JFileDialog O JFileAction O JFileChooser O JFileSelector Question 17 1 pts Consider the following code snippet: Scanner in = new Scanner(...): while (in.hasNext()) 1 String input = in.next(); > Which of the following statements about this code is correct? This code will read in a line at a time from the input file. This code will read in the entire input file in one operation. This code will read in a word at a time from the input file. It cannot be determined what will be read from the input file from the given code.
Question 18 Consider the following code snippet: public void read (String filename) throws FileNotFoundException { File inputFile = new File(filename); Scanner in = new Scanner(inputFile); . } If the file cannot be located, which of the following statements about this code is correct? This method must handle the exception in the body of the method. This method will be terminated if the file cannot be located. This method must use a throw statement to pass the error back to its caller. It cannot be determined how the method must handle the exception if the file cannot be located. D Question 19 The FileNotFoundException class is a subclass of the class. RuntimeException NoSuchelementException NullPointerException IOException
Question 18 Consider the following code snippet: public void read (String filename) throws FileNotFoundException { File inputFile = new File(filename); Scanner in = new Scanner(inputFile); . } If the file cannot be located, which of the following statements about this code is correct? This method must handle the exception in the body of the method. This method will be terminated if the file cannot be located. This method must use a throw statement to pass the error back to its caller. It cannot be determined how the method must handle the exception if the file cannot be located. D Question 19 The FileNotFoundException class is a subclass of the class. RuntimeException NoSuchelementException NullPointerException IOException