Joe Soltzberg

32%
Flag icon
To make this more concrete, consider the following code fragment: Click here to view code image // Why generic array creation is illegal - won't compile! List<String>[] stringLists = new List<String>[1];  // (1) List<Integer> intList = List.of(42);               // (2) Object[] objects = stringLists;                    // (3) objects[0] = intList;                              // (4) String s = stringLists[0].get(0);                  // (5)
Effective Java
Rate this book
Clear rating
Open Preview