Mastering Java: The Ultimate Quiz for 'Thinking in Java'

Disable ads (and more) with a membership for a one time $2.99 payment

Dive into the depths of Java with our quiz based on "Thinking in Java, Fourth Edition" by Bruce Eckel. Test your knowledge, solidify concepts, and prepare for certification with challenging questions and insightful feedback.

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


Which of the following is true about Arrays.asList()?

  1. It creates a fixed-size list

  2. It allows adding new elements

  3. It creates a new copy of the array

  4. It only works with String arrays

The correct answer is: It creates a fixed-size list

Arrays.asList() creates a fixed-size list, meaning that the size of the list cannot be changed once it is created. The other options are incorrect because B. Arrays.asList() does not allow adding new elements to the list as it is a fixed-size list. C. It does not create a new copy of the array, but rather a view of the existing array. Any changes made to the list will also affect the original array. D. It can work with any type of array, not just String arrays.