Java Software Solutions, 8e, Global Edition Exercise Solutions, Ch. 8
Chapter 8 Exercise Solutions
EX 8.1. Which of the following are valid declarations? Which instantiate an array object?
Explain your answers.
int primes = {2, 3, 4, 5, 7, 11};
Invalid; an int cannot be declared and initialized using an intializer list. The brackets are
missing.
EX 8.2. Describe five programs that would be difficult to implement without using arrays.
A program to find the average midterm score of 600 students enrolled in an introductory
computer science course.
EX 8.3. Describe how an element in an array is accessed in memory. For example, where is
myArray[25] stored in memory?