Chap 2 Flashcards

1
Q

what does the append mean in
FileWriter(String fileName, boolean append)

A

the boolean value represents whether data should be appended to the end the file or not.

If false, the file will be overwritten

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

Difference between FIleWriter and PrintWriter?

A

FileWriter is used for writing character data to a file, while PrintWriter provides more convenient methods for writing different types of data to a file.

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

What is a literal?

A

A literal is a value that is written into the code of a program.

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

What is the value of z after the following statements have been executed?

int x = 4, y= 33;
double z;
z = (double) (y / x);

A

8.0

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