Java Hold Object Learning notes

Source: Internet
Author: User

1. Holding object: The container, the object that holds the other object;

2. Interator can remove the last object produced by Next (), which means that next () must be called before a remove () is called.

3. Iterators unify the way the container is accessed;

4. Programs usually create new objects based on certain conditions that are known to the runtime;

5. Any number of objects need to be created at any time and at any location;

6. List Set Queue map,collection Container;

7. By using generics, you can prevent the compiler from placing an object of the wrong type in a container, such as arraylist<apple>;

8. If you do not need to use the index of each object, you can use the foreach syntax to select each element in the list;

9. Collection:list Set Queue

Map:arraylist Map

list<apple> apples = new arraylist<apple> (), creates an object of a specific class, converts its type to its corresponding interface, and then uses the interface in the rest of the code;

The behavior of List has changed according to the behavior of equal ().

Remove in list note that the automatic packing mechanism is used in a timely manner;

13.

list<integer> sub = pt.sublist (0, 3);
System.out.println (Sub.add (12));

There is a problem with this usage;

Next is to take itself and move one bit later, previous is to move forward one and then take a value.

Java Hold Object Learning notes

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.