IT 114: Introduction to Java
Answers to Class 22 Ungraded Quiz

  1. Can a Scanner object only be used with input from the keyboard?
    no. it can also be used with a file
  2. What do you call the string used the mark the end of one token and the beginning of the next?
    a delimiter
  3. Can a Scanner object read a file of numbers with more than one number on each line?
    yes
  4. By default what does a Scanner object use to mark the end of one token and the beginning of the next?
    whitespace
  5. If you were totaling the numbers in a file and were adding each number to the variable total what would you give total as it's first value?
    0
  6. If you were writing a program to find the maximum value which was stored in the variable max what would you give max as it's first value?
    a very low number
  7. If you were writing a program to find the maximum value which was stored in the variable min what would you give min as it's first value?
    a very high number
  8. What do you use to read information from a file?
    a Scanner object
  9. What argument do you need to create the object needs to read a file?
    a File object
  10. What kind of control structure do you use to read the information in a while?
    a while loop