18. Files Flashcards

1
Q

&laquo_space;is to * like&raquo_space; is to /, or is it vice versa?

A

Shifting left (<>) has the same effect as division.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the value of each of the following expressions?

  1. 16 & 8 & 4 & 2 & 1
  2. 16 | 8 | 4 | 2 | 1
A

ss

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What possible values are given to the method(s) used for writing data? Bytes? Characters? Lines?

A

ss

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What result is returned by PrintWriter: checkError() instance method if something has gone wrong?

A

ss

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does PrintWriter not have that PrintStream does? Is that something we want to generally use?

A

ss

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is flushing and automatic flushing?

A

ss

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Is IOException a subclass Exception or RuntimeException? Is it a checked or unchecked exception Type?

A

ss

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What possible values are returned from the method used for reading data (InputStream)? Bytes? Characters? Lines? Some other value?

A

ss

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What possible values are returned from the instance method used for reading data? Bytes? Characters? Lines? Some other value? (InputStreamReader)

A

s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What possible values are returned from the method used for reading data? Bytes? Characters? Lines? Some other value? (BufferedReader)

A

ss

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the superclass of FileInputSteam class?

A

s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

FileWriter class is merely a convenience for something. What?

A

s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do we use the File class to check for the existence of a file?

A

s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

In that order are bytes of a number written?

A

s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

In what order are bytes of a number read?

A

s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

The type of System.out and System.err is actually a subclass of OutputStream - which one?

A

s

17
Q

System: err: OutputStream allows access to the standard input, as bytes or characters.

A

s

18
Q

Does the System: in: InputStream allow access to the standard input, as bytes or characters?

A

ss

19
Q

Does System: out: OutputStream allow to access to the standard output as bytes, characters or both?

A

s

20
Q

What is the significance of the associativity of the assignment operator? Is it left or right?

A

s

21
Q

Under what circumstances is the finally block executed?

A

s

22
Q

Why is it generally a good idea not to rely on initial values of variables? Which kinds of variables are we forced to initialize?

A

s