Java Chapter 8

¡Supera tus tareas y exámenes ahora con Quizwiz!

Which statement represents the shortcut diamond syntax for declaring and constructing array lists?

ArrayList<Double> values = new ArrayList<>();

Which one of the following statements is true about passing arrays to a method?

By default, arrays are passed by reference to a method.

Which statements are true about array references? I. Assigning an array reference to another creates a second copy of the array. II. An array reference specifies the location of an array. III. Two array references can reference the same array.

II and III only

What is the result of the following code? for (double element : values) { element = 0; }

The array values is not modified.

If a method is declared to return void, then which statement below is true?

When the method terminates no value will be returned.

When an array myArray is only partially filled, how can the programmer keep track of the current number of elements?

maintain a companion variable that stores the current number of elements

An effective technique for understanding the subtle aspects of a method is to _____________.

perform a manual walkthrough.

When an array reading and storing input runs out of space, __________________.

the array must be "grown" using the growArray method


Conjuntos de estudio relacionados

IGCSE Travel and Tourism - Unit 3 - Customer Care and Working Procedures

View Set

Musculoskeletal Practice Questions

View Set

International Accounting final exam

View Set

FTCE: Subject Area K-6: Math problems

View Set

PSY 150 chapter 13If you take a class in personality psychology, which of the following topics is most likely to come up? Multiple choice question. The influence of conscientiousness on grades The cause of developmental disorders such as autism The

View Set

Anatomy and Physiology- Final Exam

View Set