Introduction to ArrayList

AP Computer Science A· difficulty 4/5

<code>list.add(5);</code> (where list is ArrayList<Integer>)

  • A

    Autoboxes 5 to Integer.valueOf(5)

    check_circle
  • B

    Stores int directly

  • C

    Throws exception

  • D

    Compile error

Explanation

Autoboxing converts int to Integer.

Want 10 more like this — adaptive to your weak spots?

Related questions