Java Effective - IV
90 points to make your coffee

4. Generics

Before generics, you had to cast every object you read from a collection. If someone accidentally inserted an object of the wrong type, casts could fail at runtime. With generics, you tell the compiler what types of objects are permitted in each collection. The compiler inserts casts for you automatically and tells you at compile time if you try to insert an object of the wrong type.

26. Don’t use raw types

27. Eliminate unchecked warnings

28. Use Lists over Arrays

29. Favor generic types

30. Favor generic types

31. Use bounded wildcards to increase API flexibility

32. Combine varargs and Generics judiciously

33. Consider typesafe heterogeneous containers

*****
Written by Martin on 24 May 2019