RandomAccess interface 源码阅读

Marker interface used by List implementations to indicate that they support fast (generally constant time) random access. The primary purpose of this interface is to allow generic algorithms to alter their behavior to provide good performance when applied to either random or sequential access lists.

这个接口用来标记实现该接口的类支持快速随机访问。以便在算法中实现更好的性能。

notes:空接口只是一个标识接口,标识某各类只要实现此接口就会具备某种特性,才能做某种事情。

你可能感兴趣的:(RandomAccess interface 源码阅读)