<code>new ArrayList<>(otherList)</code> creates
- Acheck_circle
A copy containing same elements as otherList
- B
Compile error
- C
Same reference
- D
An empty ArrayList
Explanation
Constructor accepts Collection; copies its elements.
AP Computer Science A· difficulty 4/5
<code>new ArrayList<>(otherList)</code> creates
A copy containing same elements as otherList
Compile error
Same reference
An empty ArrayList
Explanation
Constructor accepts Collection; copies its elements.
Want 10 more like this — adaptive to your weak spots?
<codelist.indexOf(99)</code for list with no 99 returns…
chevron_rightStarting with <codea = ["A","B","C","D"]</code: <code class="language-java"a.add(0, "X"); a.add(3, "Y"); a.remove("B"); </code</pre What is the final state of <…
chevron_rightWhat is printed?…
chevron_right