chapter 13 Flashcards

1
Q

what is getting stuff from a disk file to print onto a disk file in your computer, similar to?

A

it is the similar to writing on a keyboard to display onto the console screen

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

what is raw data and what is cooked data in a java program?

A

raw data is derived from your hard drive in your computer and cooked data is data that has been saved onto your hard drive.

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

what is possible with cooked data?

A

you can retrieve cooked data from your hard drive as raw data to be used in another program making it more convenient than rewriting old code from scratch

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

how do you insert code templates?

A

choose Window> preferences> resulting dialog box, choose Java> Editor> Templates

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

where should a rawData.txt file be located?

A

in the root of a project folder on your hard drive

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

how do you call to close when using a diskScanner in your program?

A

diskScanner.close()

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

what is the basic format for using diskScanner in your code?

A

Scanner diskScanner = new Scanner(new File(“file”));

String oneWord = diskScanner.next();

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

when using diskScanner in your program where is the scanner looking to find a file?

A

in the root of the program’s project folders

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

what is it called after the dot in a file name

A

in a file name, anything that you put after a dot is called a filename extension

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

what is a printStream?

A

similar to a scanner but instead it is used to output data in the console or file but a Scanner can read from files, strings, or the console.

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

what is the difference between “System.in” and the expression “new File(“rawData.txt”)” ?

A

“System.in” stands for the computer’s keyboard
&
the expression “new File(“rawData.txt”)” stands for a file on your computer’s hard drive

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

what is FileNotFoundException and when does this occur?

A

a FileNotFoundException is something that may go wrong during an attempt to read input from a disk file or an attempt to write output to a disk file.

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

how do you brace against problems with disk file access?

A

java insists on you adding some extra words to your code, FileNotFoundException forming a throws clause.

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

what is a throws clause ?

A

it’s a kind of disclaimer like a warning saying “I realize that this code can run into trouble”.

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

what happens if you do not put FileNotFoundException in your code when it comes to using code with disk access?

A

when it comes to disk access, if you do not put a throws clause like FileNotFoundException the java compiler refuses to compile your code.

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