Services
Discover
Homeschooling
Ask a Question
Log in
Sign up
Filters
Done
Question type:
Essay
Multiple Choice
Short Answer
True False
Matching
Topic
Computing
Study Set
Big Java Early Objects
Quiz 11: Input/Output and Exception Handling
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Practice Exam
Learn
Question 21
Multiple Choice
When reading words with a Scanner object, a word is defined as ____.
Question 22
Multiple Choice
Consider the following code snippet. File hoursFile = new File("hoursWorked.txt") ; Your program must read the contents of this file using a Scanner object.Which of the following is the correct syntax for doing this?
Question 23
Multiple Choice
Which method of the JFileChooser object will return the file object that describes the file chosen by the user at runtime?
Question 24
Multiple Choice
Insert the missing code in the following code fragment.This fragment is intended to write an output file named dataOut.txt that resides in a folder named reports on the C: drive of a Windows system.
Question 25
Multiple Choice
Which of the following statements about using a PrintWriter object is NOT true?
Question 26
Multiple Choice
Insert the missing code in the following code fragment.This fragment is intended to read a web page.
Question 27
Multiple Choice
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.
Question 28
Multiple Choice
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.
Question 29
Multiple Choice
Consider the following code snippet. Scanner inputFile = new Scanner("hoursWorked.txt") ; Which of the following statements is correct?
Question 30
Multiple Choice
Insert the missing code in the following code fragment.This fragment is intended to allow the user to select a file to be opened.
Question 31
Multiple Choice
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.
Question 32
Multiple Choice
Which of the following statements about character encodings is NOT true?
Question 33
Multiple Choice
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?
Question 34
Multiple Choice
Which return value of the JFileChooser object's showOpenDialog method indicates that a file was chosen by the user at run time?
Question 35
Multiple Choice
Consider the following code snippet. PrintWriter outputFile = new PrintWriter("payrollReport.txt") ; Which of the following statements about the PrintWriter object is correct?
Question 36
Multiple Choice
Consider the following code snippet. Scanner inputFile = new Scanner("dataIn.txt") ; Which of the following statements is correct?
Question 37
Multiple Choice
Your program must read in an existing text file.You want the program to terminate if any exception related to the file occurs.Which of the following indicates the correct code for the header of the main method?