Collection and collections; differences between array and Arrays

Source: Internet
Author: User
The difference between collection and collections.

Collection is an interface under java. util. It is the parent interface of various collection structures. The inherited interfaces mainly include set and list.

Collections is a dedicated static class under java. util. It contains various static methods related to set operations. Provides a series of static methods for searching, sorting, and thread security operations on various sets.

The difference between array and arrays.

1. array class array is the most basic storage structure in Java. Allows you to dynamically create and access Java arrays. The element types must be the same. High efficiency, but the capacity is fixed and cannot be changed dynamically. It cannot determine how many elements actually exist, and length only tells us the size of the array.

2. arrays class. This static class is used to operate arrays and provides static methods such as search, sorting, and replication. Equals (): checks whether two arrays are equal. Array has the same number of elements, and all corresponding elements are equal to each other. Sort (): used to sort arrays. Binarysearch (): Search for elements in the sorted array.

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.