Exam 10: File IO
Exam 1: Getting Started45 Questions
Exam 2: Console Input and Output29 Questions
Exam 3: Flow of Control44 Questions
Exam 4: Defining Classes I45 Questions
Exam 5: Defining Classes II46 Questions
Exam 6: Arrays46 Questions
Exam 7: Inheritance43 Questions
Exam 8: Polymorphism and Abstract Classes43 Questions
Exam 9: Exception Handling45 Questions
Exam 10: File IO46 Questions
Exam 11: Recursion44 Questions
Exam 12: Uml and Patterns22 Questions
Exam 13: Interfaces and Inner Classes32 Questions
Exam 14: Generics and the Arraylist Class32 Questions
Exam 15: Linked Data Structures43 Questions
Exam 16: Collections,maps,and Iterators44 Questions
Exam 17: Swing I37 Questions
Exam 18: Swing II31 Questions
Exam 19: Java Never Ends26 Questions
Exam 20: Applets25 Questions
Select questions type
Binary files can be handled more efficiently than text files.
Free
(True/False)
4.7/5
(36)
Correct Answer:
True
Files whose contents must be handled as sequences of binary digits are called:
Free
(Multiple Choice)
5.0/5
(28)
Correct Answer:
C
Explain what happens when an output file is opened in Java.
Free
(Essay)
4.7/5
(44)
Correct Answer:
In Java,when an output stream is connected to a file,the program always starts with an empty file.If the file you are trying to connect to exists,the contents of the file are deleted before the output stream writes new data to the file.If the file you are trying to connect to does not exist,then a new empty file is created.
Write a Java statement to create an input stream to the binary file statistics.dat.
(Essay)
4.8/5
(31)
Write a Java statement to create an input stream to a file named "statistics.dat".
(Essay)
4.9/5
(42)
The methods of the scanner class do not behave the same when reading from a text file as they do when used to read from the keyboard.
(True/False)
4.9/5
(36)
The method __________ from the File class forces a physical write to the file of any data that is buffered.
(Multiple Choice)
4.7/5
(43)
Write a Java statement to create and open an output stream to a file named autos.txt.
(Essay)
4.8/5
(29)
The class ObjectInputStream contains all of the following methods except:
(Multiple Choice)
4.9/5
(35)
Using BufferedReader to read integers from a file requires the String input to be parsed to an integer type.
(True/False)
4.8/5
(47)
The class ObjectOutputStream contains all of the following methods except:
(Multiple Choice)
5.0/5
(41)
Write a Java statement that creates a stream that provides read/write access to the file named autos.txt.
(Essay)
4.8/5
(39)
Create try and catch block that opens a file named statistics.txt for output.Writes the integers 24,55,and 76 to the file,and then closes the file.
(Essay)
4.9/5
(44)
Every input file and every output file used by your program has only one name which is the same name used by the operating system.
(True/False)
4.8/5
(40)
A stream is an object that allows for the flow of data between your program and some I/O device or some file.
(True/False)
4.9/5
(33)
Only the classes provided for file output contain a method named close.
(True/False)
4.9/5
(36)
The stream that is automatically available to your Java code is:
(Multiple Choice)
4.9/5
(35)
When your program is finished writing to a file,it should close the stream connected to that file.
(True/False)
4.8/5
(41)
Write a complete Java program using a Scanner object that opens a file named autos.txt and displays each line to the screen.
(Essay)
4.7/5
(33)
Showing 1 - 20 of 46
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)