Actual Final Flashcards

1
Q

IMPORTANT NOTE: Creating a File object DOES NOT create a corresponding file folder on your hard drive. (T!)

A

NOTE: No folder is created on the disk when this object is instantiated BUT…we could later actually create the directories on the disk by using methods such as mkdir() and mkdirs()

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

Using getParentFile()

A

File fileOne = new File(“C:/temp34/myFile.txt”); fileOne.getParentFile().mkdirs(); //this builds the temp34 folder //now call createNewFile() fileOne.createNewFile(); //creates the empty .txt file in temp 34

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

any exceptions of the UNCHECKED flavor the coder does not have to write any special code called “exception handling code” .

A

Options that are unchecked include the ArithmeticException and the ArrayIndexOutOfBoundsException.

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

CONCEPT: A delimiter is a block of character(s) that separates words. WE DO NOT PRINT OUT THE DELIMITER character(s)

A

it takes as an argument something called a regular expression, which is a pattern of a set of character(s) inside a set of square brackets that it either looks for or ignores, depending on how you set it up

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

Example: the regular expression [0-9]+ would be a delimiter that says “interpret any block of one or more digits as a delimiter and do not print it to the screen”.

A

Example 2: in the regular expression[^0-9]+, the “^” caret symbol would mean “DO NOT include any digits in the delimiter” , but ALL OTHER CHARACTERS would be considered to be part of the delimiter, so they would not be printed.

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

One way to create a PrintWriter object is to call its constructor and pass it a file name: File

A

File myFile = new File(“output.txt”); Printwriter writer = new PrintWriter(myFile);

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