Exam 11: Input/Output and Exception Handling

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Which method of the JFileChooser object will return the file object that describes the file chosen by the user at runtime?

(Multiple Choice)
4.8/5
(40)

Insert the missing code in the following code fragment.This fragment is intended to read an input file named dataIn.txt and write to an output file named dataOut.txt. Insert the missing code in the following code fragment.This fragment is intended to read an input file named dataIn.txt and write to an output file named dataOut.txt.

(Multiple Choice)
4.8/5
(33)

Which of the following statements reflects the recommendations about closing files?

(Multiple Choice)
4.8/5
(40)

Consider the following code snippet: Consider the following code snippet:   How can the program ensure that the file will be closed if an exception occurs on the writeData call? How can the program ensure that the file will be closed if an exception occurs on the writeData call?

(Multiple Choice)
4.9/5
(47)

Insert the missing code in the following code fragment.This code is intended to open a file and handle the situation where the file cannot be found. Insert the missing code in the following code fragment.This code is intended to open a file and handle the situation where the file cannot be found.

(Multiple Choice)
4.7/5
(34)

Consider the following code snippet: Consider the following code snippet:   If there is no integer number appearing next in the input, what will occur? If there is no integer number appearing next in the input, what will occur?

(Multiple Choice)
4.8/5
(43)

Consider the following code snippet: Consider the following code snippet:   Which of the following statements about this code is correct? Which of the following statements about this code is correct?

(Multiple Choice)
4.8/5
(47)

Which Java class implements a file dialog box for selecting a file by a program with a graphical user interface?

(Multiple Choice)
4.8/5
(43)

The Java compiler requires that your program handle which type of exceptions?

(Multiple Choice)
4.7/5
(38)

Which of the following objects should be used for reading from a text file?

(Multiple Choice)
5.0/5
(41)

Which of the following statements about using a PrintWriter object is NOT true?

(Multiple Choice)
4.9/5
(33)

Which return value of the JFileChooser object's showOpenDialog method indicates that a file was chosen by the user at run time?

(Multiple Choice)
4.8/5
(27)

Under which condition will the PrintWriter constructor generate a FileNotFoundException?

(Multiple Choice)
4.8/5
(41)

Consider the following code snippet. Consider the following code snippet.   Which of the following statements about this code is correct? Which of the following statements about this code is correct?

(Multiple Choice)
4.9/5
(31)

Consider the following code snippet: PrintWriter out = new PrintWriter("output.txt"); If a file named "output.txt" already exists, which of the following statements about the PrintWriter object is correct?

(Multiple Choice)
4.9/5
(45)

Which of the following patterns should be used for the delimiter to read one character at a time using a Scanner object's next method?

(Multiple Choice)
4.8/5
(44)

Consider the following code snippet: Consider the following code snippet:   What characters will be ignored and not read in using this code? What characters will be ignored and not read in using this code?

(Multiple Choice)
4.8/5
(30)

Insert the missing code in the following code fragment.This fragment is intended to read floating-point numbers from a text file. Insert the missing code in the following code fragment.This fragment is intended to read floating-point numbers from a text file.

(Multiple Choice)
5.0/5
(30)

What is the purpose of the throw statement?

(Multiple Choice)
4.8/5
(39)

When writing a method, which of the following statements about exception handling is true?

(Multiple Choice)
4.7/5
(40)
Showing 21 - 40 of 108
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)