This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I have a vector (LimitSet) of "Limit" objects, a limit consisting of an integer (pos) and a double (speed). How would I (if I even can) use Collections.sort to order the contents of the LimitSet by "pos"?
Use the version of sort() that takes a java.util.Comparator as an argument. Provide a Comparator implementation which compares two Limit objects by subtracting their "pos" members and returning the result.