Robert

68%
Flag icon
This is done for performance, but as an added benefit, it ensures that the input list will be untouched if the sort fails.
Robert
Pro-tip: Be skeptical about actually counting on this behavior. The implementation could theoretically change so that the sort happens in-place if the list has the RandomAccess marker interface (avoid the two copy operations for efficiency).
Effective Java: A Programming Language Guide (Java Series)
Rate this book
Clear rating
Open Preview