This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
3.java.util.Arraylist are described? a)The elements in the collection are ordered b)The collection is guaranteed to be immutable. c)The elements in the collection are guaranteed to be unique. d)The elements in the collection are accessed using a unique key e)The elements in the collection are guaranteed to be synchronized
Q2) Which descrive HashSet ? 1) elements stored are unique? 2) have unique keys?
Q3) below compiles(with no further change) char c = '\ucafe'; WHY?
Hi Kevin, I don't really think this stuff is URGENT!!! 3. a - correct --> lists are always ordered b - wrong --> can be changed any time c - wrong --> can be any objects d - wrong --> only Maps are accessed with unique keys e - wrong --> According to API
Note that this implementation is not synchronized. If multiple threads access an ArrayList instance concurrently, and at least one of the threads modifies the list structurally, it must be synchronized externally. (A structural modification is any operation that adds or deletes one or more elements, or explicitly resizes the backing array; merely setting the value of an element is not a structural modification.)
Q2. 1 - correct --> set always has unique values 2 - wrong --> Only maps have keys Q3. Because it is a valid unicode character. Regards, Manfred.
Hi Kevein, Ans 1. a) is true since ArrayList implements List interface. b) is false since ArrayList can increase or decrease in size. c) is false since duplicate is allowed. d) is false since keys and values are for Maps. e) is false( i think). Ans 2. HashSet implements Set interface and does'nt allow duplicates. 2) is false as keys are for Maps. Elizabeth.