Java Collection Framework

Source: Internet
Author: User

Address: http://www.runoob.com/java/java-collections.htmlJava Collection Framework

Before Java 2, Java provided the ad hoc class. For example: Dictionary, Vector, Stack, and properties These classes are used to store and manipulate groups of objects.

Although these classes are useful, they lack a central, unified theme. For this reason, the way you use the vector class differs greatly from the way you use the Properties class.

The collection framework is designed to meet several goals.

    • The framework must be high-performance. The implementation of the basic set (dynamic array, linked list, tree, hash table) must also be efficient.
    • The framework allows different types of collections to work in a similar way, with a high degree of interoperability.
    • The expansion and adaptation of a set must be simple.

To do this, the entire collection framework is designed around a standard set of interfaces. You can use the standard implementations of these interfaces directly, such as LinkedList, HashSet, and TreeSet, and you can implement your own collections via these interfaces.

A collection framework is a unified schema used to represent and manipulate collections. All the collection frameworks include the following:

    • interface: is an abstract data type that represents a collection. The interface allows the collection to manipulate the details of its representatives independently. In object-oriented languages, interfaces usually form a hierarchy.
    • implementation (Class): is the specific implementation of the collection interface. Essentially, they are reusable data structures.
    • algorithm: is a useful calculation for the execution of methods in an object that implements a collection interface, for example: Search and sort. These algorithms are called polymorphic, because the same approach can have different implementations on similar interfaces.

In addition to the collection, the framework also defines several map interfaces and classes. A key/value pair is stored in the map. Although maps are not collections, they are fully integrated in the collection.

Set Frame system

The Java Collection Framework provides a set of well-performing, easy-to-use interfaces and classes, and the Java Collection framework is located in the Java.util package, so a guide is required when using the collection framework.

Java Collection Framework

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.