Joe Soltzberg

36%
Flag icon
The swapHelper method knows that list is a List<E>. Therefore, it knows that any value it gets out of this list is of type E and that it’s safe to put any value of type E into the list. This slightly convoluted implementation of swap compiles cleanly.
Joe Soltzberg
Feels hacky...
Effective Java
Rate this book
Clear rating
Open Preview