Exam 11: Input/Output and Exception Handling

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

When a program throws an exception within a method that has no try-catch block, which of the following statements about exception handling is true?

(Multiple Choice)
4.8/5
(38)

Which of the following statements about assertions is NOT true?

(Multiple Choice)
4.9/5
(43)

Under which condition will the Scanner constructor generate a FileNotFoundException?

(Multiple Choice)
4.9/5
(37)

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
(33)

Insert the missing code in the following code fragment.This fragment is intended to read a web page. Insert the missing code in the following code fragment.This fragment is intended to read a web page.

(Multiple Choice)
4.9/5
(40)

Your program wishes to open a file named C:\java\myProg\input.txt on a Windows system.Which of the following is the correct code to do this?

(Multiple Choice)
4.7/5
(41)

An example of a fatal error that rarely occurs and is beyond your control is the ____.

(Multiple Choice)
4.8/5
(31)

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
(32)

Which of the following statements about command line arguments is correct?

(Multiple Choice)
4.8/5
(44)

Insert the missing code in the following code fragment.This fragment is intended to read an input file named hoursWorked.txt.You want the program to terminate if the file does not exist. Insert the missing code in the following code fragment.This fragment is intended to read an input file named hoursWorked.txt.You want the program to terminate if the file does not exist.

(Multiple Choice)
4.8/5
(42)

Assuming that inputFile is a Scanner object used to read words from a text file, select an expression to complete the following code segment, which counts the number of words in the input file. Assuming that inputFile is a Scanner object used to read words from a text file, select an expression to complete the following code segment, which counts the number of words in the input file.

(Multiple Choice)
4.7/5
(32)

Which method of an exception object will provide information about the chain of method calls that led to the exception?

(Multiple Choice)
5.0/5
(41)

You have opened a command prompt window and you have entered the following: java myProg Bob Smith Which of the following statements is correct?

(Multiple Choice)
4.9/5
(38)

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

(Multiple Choice)
4.9/5
(33)

Insert the missing code in the following code fragment.This fragment is intended to read an input file named dataIn.txt that resides in a folder named payroll on the C: drive of a Windows system. Insert the missing code in the following code fragment.This fragment is intended to read an input file named dataIn.txt that resides in a folder named payroll on the C: drive of a Windows system.

(Multiple Choice)
4.8/5
(34)

Which of the following statements about white space in Java is correct?

(Multiple Choice)
4.9/5
(46)

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

(Multiple Choice)
4.7/5
(34)

Which of the following code snippets about exceptions is correct?

(Multiple Choice)
4.9/5
(37)

Your program will read in an existing text file.You want the program to terminate if the file does not exist.Which of the following indicates the correct code for the main method header?

(Multiple Choice)
4.8/5
(41)

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

(Multiple Choice)
4.9/5
(42)
Showing 61 - 80 of 108
close modal

Filters

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