It is something
you should avoid; lots of casts means your classes are designed badly. Look at
this method, which isn't in the
List interface. If you want to use it, you have to do some horrible
testing with instanceof to prevent class cast exceptions:-
LinkedList doesn't have such a method because the size of a linked list and its capacity are always the same. I shall leave you to work out how to handle such a method in
this List implementation.