Arrays
Reading
- Please read sections 7.1–7.3 of the Introduction to Programming with Java.
Important concepts
- Array
- Bounds checking
Instructor note
In the grand tradition of computer science, the terminology here is confusing. The terms “array,” “list,” “vector,” and “tuple” can all means “an ordered sequence of items indexed by number.” These terms appear across many languages, but their meaning varies a great deal from language to language.
The particular distinction between lists and arrays that Java makes is a Java-specific thing. For example, Swift, Ruby, and JavaScript all have things that they call an “array” that are resizable, and resemble Java lists much more than Java arrays.
The moral here is to learn the terminology of the language you’re using, and be aware that computer science is a young and inconsistent discipline.
Things to consider (exercises for yourself, not to turn in)
- What are the differences between an array and a list in Java?
- What is the point of having arrays if Java already has lists?
Your response
What was particularly interesting, confusing, or exciting to you in this reading?