O'Reilly logo

Programmer's Guide to Java™ Certification, A: A Comprehensive Primer, Second Edition by Rolf W. Rasmussen, Khalid A. Mughal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Review Questions

11.4 Which statements are true about collections?

Select the two correct answers.

  1. Some operations on a collection may throw an UnsupportedOperationException.

  2. Methods calling optional operations in a collection must either catch an UnsupportedOperationException or declare it in their throws clause.

  3. A List can have duplicate elements.

  4. An ArrayList can only accommodate a fixed number of elements.

  5. The Collection interface contains a method named get.

11.5 What will be the result of attempting to compile and run the following program?
 import java.util.*; public class Sets { public static void main(String[] args) { HashSet set1 = new HashSet(); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required