I recently had a discussion with a collegue why the List interface in Java doesn\'t have a head()
and tail()
method.
In order to implement
there are always choices one must make in good API design. there are lots of methods that could be added to the API, however, you have to find the fine line between making the API usable for most people and making it too cluttered and redundant. as it is, you can implement the tail method as you have shown in an efficient way for most List implementations, and LinkedList already has a getLast() method.