201671010106 2016-2017-2 "Java Programming" learning experience

Source: Internet
Author: User

In this week's study, the main understanding of the Java Collection framework, the Java Collection framework mainly for the encapsulation of data structure, the collection is composed of multiple elements and provides the operation method of the contained elements of the class, its containing elements can be the same type of elements of the object, or can be composed of different objects. The characteristic of a collection class in Java, unlike an array, is that the collection accommodates only the object. The collection class holds an instance of the object class, and the collection class in JDK1.1 has a vector Stack HashTable, which is similar to a variable-length array; the vector can only hold objects; the vector's elements are accessed by subscript. The Stack class is a subclass of a vector, and the stack class is a description of the stacking data structure; The Hashtable class finds the element by key; The Hashtable class uses a special value to determine the key, called Hascode, and all objects are in a hashcode, Can be obtained through the hashcode () method of the object class.

The collection, Set, list, Map, SortedMap are also known in this chapter. Collection is the root interface in the collection hierarchy, the JDK is not the implementation class that provides this interface directly, the set cannot contain duplicate elements, the elements must be unique, and the object elements added to the set must define the Equals method. To provide an algorithm to determine whether the object to be added is equal to an already existing object, thus establishing the uniqueness of the object, The class that implements the set interface has HashSet and TreeSet. The most obvious feature in the list is that the elements in it have a definite order, and the classes that implement it have ArrayList and LinkedList; The elements in the ArrayList are stored sequentially in memory, and the elements in the LinkedList are stored in memory in the form of a linked list.

In this chapter, it is necessary to annotate the code, to understand the meaning of the program, and to clarify the function of each line of code.

201671010106 2016-2017-2 "Java Programming" learning experience

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.