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 Binder Early Objects
Quiz 11: Inputoutput and Exception Handling
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Practice Exam
Learn
Question 101
Multiple Choice
Consider the following code snippet: try { PrintWriter outputFile = new PrintWriter(filename) ; Try { WriteData(outputFile) ; } Finally { OutputFile.close() ; } } Catch (IOException exception) { ) . . } Which of the following statements about this code is correct?
Question 102
Multiple Choice
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. public void String readFile() _________________ { File inputFile = new File(. . .) ; Scanner in = new Scanner(inputFile) ; Try { While (in.hasNext() ) { ) . . } } Finally { In) close() ; } }
Question 103
Multiple Choice
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. public void String readFile() throws IOException { File inputFile = new File(. . .) ; Scanner in = new Scanner(inputFile) ; Try { While (in.hasNext() ) { ) . . } } Finally { ___________________ } }
Question 104
Multiple Choice
Consider the following code snippet: Scanner in = new Scanner(. . .) ; ) . . If (in.hasNext() ) { Throw new IOException("End of file expected") ; } Which of the following statements about this code is correct?