Introduction to ArrayList

AP Computer Science A· difficulty 4/5

<code>ArrayList<Dog> dogs = new ArrayList<>();</code> allows

  • A

    Storing Strings

  • B

    Storing Dog references

    check_circle
  • C

    Storing primitives

  • D

    Mixing with Cat references (compile error)

Explanation

Type-safe: only Dog (or subclasses).

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

Related questions