Tick each line when you can do it without looking at the guide. Each line names where it is taught and tested. Revisit the study guide for anything you cannot yet do.
Understanding
- ☐ I can explain why a file is needed to keep data after the program ends (study guide: Why programs need files).
- ☐ I can name the imports and the header clause needed to read a file (study guide: The standard pattern; practice: Question 1).
- ☐ I can describe the Scanner cursor and say why it never moves backwards (study guide: The Scanner methods you need; Figure 1).
- ☐ I can say what
hasNext()does and that it does not move the cursor (practice: Question 7).
Skills
- ☐ I can write the five-step pattern: File, Scanner, hasNext loop, read, close (study guide: Worked example 1; practice: Question 9).
- ☐ I can trace a Scanner loop token by token and give the final result (study guide: Worked example 1; practice: Question 2).
- ☐ I can choose between
next,nextInt,nextDouble,nextBooleanandnextLinefor a given file layout (practice: Questions 5 and 8). - ☐ I can read records line by line, split them and convert a field to a number (study guide: Worked example 2; practice: Question 10).
Reasoning
- ☐ I can predict which exception is thrown for a wrong-kind token or for reading past the end (practice: Questions 3 and 6).
- ☐ I can predict the length of a
splitresult, including dropped trailing empty strings (practice: Question 4). - ☐ I can explain why
>and>=give different answers when records tie (study guide: Worked example 2). - ☐ I can say what happens when the file is empty (study guide: Common misconceptions; practice: Question 10).
Next: Topic 4.7 wrapper classes.