Home | | Web Programming | The RandomAccess Interface - Java

Chapter: Java The Complete Reference : The Java Library : java.util : The Collections Framework

The RandomAccess Interface - Java

The RandomAccess interface contains no members. However, by implementing this interface, a collection signals that it supports efficient random access to its elements.

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.


Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail
Java The Complete Reference : The Java Library : java.util : The Collections Framework : The RandomAccess Interface - Java |


Privacy Policy, Terms and Conditions, DMCA Policy and Compliant

Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.