February 2014
Beginner
1248 pages
62h 25m
English
Class Collections provides methods for reversing, filling and copying Lists. Collections method reverse reverses the order of the elements in a List, and method fill overwrites elements in a List with a specified value. The fill operation is useful for reinitializing a List. Method copy takes two arguments—a destination List and a source List. Each source List element is copied to the destination List. The destination List must be at least as long as the source List; otherwise, an IndexOutOfBoundsException occurs. If the destination List is longer, the elements not overwritten are unchanged.
Each method we’ve seen so far operates on Lists. Methods min and max each operate on any Collection. Method ...
Read now
Unlock full access