Chapter 9


Chapter 8

1. 

Arrays are contiguously allocated memory elements of homogeneous data types. Explain in your own words what this means.

image from book

2. 

What’s the difference between arrays of primitive types vs. arrays of reference types?

image from book

3. 

Java array types directly subclass what Java class?

image from book

4. 

Every Java array type has a corresponding object of this type in memory. What type is it?

image from book

5. 

What two interfaces do Java array types implement?

 - cloneable, serializable

6. 

How do you determine the length of an array?

 - by accessing the length attribute of the array reference

7. 

Java multidimensional arrays are _______________ of ______________.

image from book

8. 

When a multidimensional array is created which dimensions are optional and which dimensions are mandatory?

 - the leftmost dimensions are mandatory and the rightmost dimension is optional

9. 

What is meant by the term “ragged array”?

 - a multidimensional array with varying length rightmost array dimensions

10. 

What’s the purpose of the main() method String array?

 - enables the passing of command-line arguments into a program

Answers

1. 

- the primitive type values or references the array contains are located one after the other in memory

2. 

- the elements of an array of primitive types contain actual values; the elements of reference type arrays contain references to objects created in the heap

3. 

- java.lang.Object

4. 

- java.lang.Class

5. 

- Cloneable, Serializable

6. 

- by accessing the length attribute of the array reference

7. 

- arrays of arrays

8. 

- the leftmost dimensions are mandatory and the rightmost dimension is optional

9. 

- a multidimensional array with varying length rightmost array dimensions

10. 

- enables the passing of command-line arguments into a program




Java For Artists(c) The Art, Philosophy, and Science of Object-Oriented Programming
Java For Artists: The Art, Philosophy, And Science Of Object-Oriented Programming
ISBN: 1932504052
EAN: 2147483647
Year: 2007
Pages: 452

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net