Exam 13: File Input and Output
Exam 1: Creating Your First Java Classes76 Questions
Exam 2: Using Data81 Questions
Exam 3: Using Methods, Classes and Objects79 Questions
Exam 4: More Object Concepts84 Questions
Exam 5: Making Decisions80 Questions
Exam 6: Looping77 Questions
Exam 7: Characters, Strings and the Stringbuilder82 Questions
Exam 8: Arrays77 Questions
Exam 9: Advanced Array Concepts80 Questions
Exam 10: Introduction to Inheritance78 Questions
Exam 11: Advanced Inheritance Concepts78 Questions
Exam 12: Exception Handling79 Questions
Exam 13: File Input and Output78 Questions
Exam 14: Introduction to Swing Components79 Questions
Exam 15: Using Javafx and Scene Builder65 Questions
Select questions type
import java.nio.file.*;
public class PathDemo
{
public static void main(String[] args)
{
Path filePath = Paths.get("C:\\Java\\Input.Output\\LessonInfo.txt");
int count = filePath.getNameCount();
System.out.println("Path is " + filePath.toString());
System.out.println("File name is " +
filePath.getFileName());
System.out.println("There are " + count +
" elements in the file path");
for(int x = 0; x < count; ++x)
System.out.println("Element " + x + " is " +
filePath.getName(x));
}
}
The above code demonstrates the creation of a Path and its method. Describe the output that will display when the code is executed.
(Essay)
4.9/5
(41)
How can you assign program output to a file, rather than to the standard output device? Explain how this works. Give an example.
(Essay)
4.7/5
(38)
You can direct System.err to a new location, such as a disk file or printer, but you cannot direct System.out to a new location.
(True/False)
4.9/5
(38)
A(n) ____ is a holding place for bytes that are waiting to be read or written.
(Multiple Choice)
4.8/5
(38)
Match each term with the correct statement below.
Premises:
A complete path
Responses:
System.getProperty("line.separator")
data file
flushing
Correct Answer:
Premises:
Responses:
(Matching)
4.8/5
(34)
You can use Java's ____ class to create your own random access files.
(Multiple Choice)
4.9/5
(38)
Match each term with the correct statement below.
Premises:
The memory location where bytes are held after they are logically output but before they are sent to the output device
Responses:
seekable
static import feature
absolute path
Correct Answer:
Premises:
Responses:
(Matching)
4.8/5
(32)
If you simply want to display records in order based on their key field, you need to create a random access file.
(True/False)
4.9/5
(41)
Match each term with the correct statement below.
Premises:
Allows you to use static constants without their class name
Responses:
close the files
data file
System.getProperty("line.separator")
Correct Answer:
Premises:
Responses:
(Matching)
4.9/5
(35)
FileChannel fc = null;
Path file =
Paths.get("C:\\Java\\Chapter.13\\RandomEmployees.txt");
Given the two declarations above, write a Java statement that creates a ByteChannel that is cast to a FileChannel . The file shoould be open for read and write operations.
(Short Answer)
4.9/5
(37)
Match each term with the correct statement below.
Premises:
Returns the default line separator for a system
Responses:
flushing
buffer
root
Correct Answer:
Premises:
Responses:
(Matching)
4.9/5
(42)
Match each term with the correct statement below.
Premises:
A collection of related records
Responses:
stream
wrapped
root
Correct Answer:
Premises:
Responses:
(Matching)
4.9/5
(35)
A(n) ____ object is an avenue for reading and writing a file.
(Multiple Choice)
4.9/5
(33)
Showing 61 - 78 of 78
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)