List Basics

  1. Read this code. The code and its comments are the reading. (Remember to run the code for yourself, see what it does, and try experimenting with it. Here are the instructions for doing that.)
  2. Read this short text about software testing.
  • list
  • for-each loop
  • scope
  • zero-based indexing
  • mutable vs. immutable
  • manual vs automated tests
  • unit vs integration tests
  1. In the nested loops example, try swapping lines 90 and 91 (i.e. switch which loop is inside and which loop is outside). How does the output change? Why?
  2. Why would you guess it might be useful to have immutable lists? Shouldn’t all lists be mutable, just in case?

What was particularly interesting, confusing, or exciting to you in this reading?