The
RandomAccess Interface
The RandomAccess interface contains no members. However, by
implementing this interface, a collection signals that it supports efficient
random access to its elements. Although a collection might support random
access, it might not do so efficiently. By checking for the RandomAccess interface, client code can
determine at run time whether a collection is suitable for certain types of
random access operations—especially as they apply to large collections. (You
can use instanceof to determine if a
class implements an interface.) RandomAccess
is implemented by ArrayList and by
the legacy Vector class, among
others.
Related Topics
Privacy Policy, Terms and Conditions, DMCA Policy and Compliant
Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.