<code>ArrayList<Dog> dogs = new ArrayList<>();</code> allows
- A
Storing Strings
- Bcheck_circle
Storing Dog references
- C
Storing primitives
- D
Mixing with Cat references (compile error)
Explanation
Type-safe: only Dog (or subclasses).
AP Computer Science A· difficulty 4/5
<code>ArrayList<Dog> dogs = new ArrayList<>();</code> allows
Storing Strings
Storing Dog references
Storing primitives
Mixing with Cat references (compile error)
Explanation
Type-safe: only Dog (or subclasses).
Want 10 more like this — adaptive to your weak spots?