Multiple choice technology programming languages

True or false: It is preferable to write: List dogs = new ArrayList(); instead of List dogs = new ArrayList(); because raw types enable developers to avoid needless verbiage.

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Using generic types (List) is strongly preferable over raw types (List). Raw types disable type checking, allowing runtime ClassCastException errors that generics would catch at compile-time. The 'verbiage' of generic types provides type safety - it's not needless. Joshua Bloch's Effective Java explicitly advises against raw types.