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

  1. If you had an array numbers, what would you write to get the first value?
    numbers[0]
  2. If the array numbers contained 5 values, what would you write to get the last value?
    numbers[4]
  3. What do you call the values in an array?
    elements
  4. Can an array contain values of different data types?
    no
  5. Can you change the size of an array after you have declared it?
    no
  6. What would you write if you wanted to change the 2nd value in the array numbers to 6?
    numbers[1] = 6
  7. What do you call the number that specifies a particular value inside an array?
    an index
  8. What expression would you write to get the length of the array numbers?
    numbers.length
  9. Rewrite the statement below using and augmented assignment operator.
    x = x + 1
    x += 1
  10. Rewrite the statement below using and augmented assignment operator.
    y = y - 1
    y -= 1