Java I/O Fundamentals Flashcards
What is the result of the expression “10” + “10”?
1010
Which System method retrieves a Console instance?
console
Which keyword indicates an instance field should be omitted during serialization?
transient
Which System method resets the System.out stream from the console?
setOut
Which Console method ensures secure entry by suppressing the echo of characters and returning a char array that can be overwritten?
readPassword
What are the three built-in streams provided by Java?
System.in, System.out, System.err
Which fields are omitted during serialization?
static and instance fields with the transient keyword
Which marker interface indicates a class can be written to and read from a stream?
Serializable
What determines whether an additive operator performs arithmetic addition or string concatenation?
The data type of its operands
When performing a read operation, which value indicates an end of file?
-1
Which method of the BufferedReader class ignores and discards a specified number of characters?
skip
Is FilterReader an interface, abstract class, or concrete class?
FilterReader is an abstract class for reading filtered character streams. The abstract class FilterReader itself provides default methods that pass all requests to the contained stream.
What classes implement a getChannel method?
The getChannel() method is implemented by only the RandomAccessFile and FileInputStream classes.
What is a FileChannel?
A file channel is a SeekableByteChannel that is connected to a file. It has a current position within its file which can be both queried and modified. The file itself contains a variable-length sequence of bytes that can be read and written and whose current size can be queried. The size of the file increases when bytes are written beyond its current size; the size of the file decreases when it is truncated. The file may also have some associated metadata such as access permissions, content type, and last-modification time; this class does not define methods for metadata access.
Is Closeable an Interface, Abstract Class, or Concreate Class
Interface