Java programming ideology Reading Note 3 (11-21), programming ideology 11-21

Source: Internet
Author: User

Java programming ideology Reading Note 3 (11-21), programming ideology 11-21

11. Objects held

Hold object instance

● Arrays associate numbers with objects. It stores objects with clear types. You do not need to convert the result type when querying objects. It can be multidimensional.

You can save basic data types. However, once an array is generated, the capacity will not change.

● Collection stores a single element, while Map stores the associated key-value pairs. With the generic type, you can specify the type of the object to be stored. type conversion is not required when obtaining the object. Various collections and maps can be automatically adjusted. The container cannot hold the basic type. But it is automatically packaged.

● Like an array, the List also establishes a correlation between a digital index and an object. Therefore, arrays and lists are all well-arranged containers. List can be automatically expanded.

● If a large amount of random access is required, ArrayList is used. If data is often inserted and deleted, the sequence list is used.

● Various Queue and stack behaviors are supported by the Queue list.

● Map is a design that associates objects with objects. HashMap is used for quick access. TreeMap keeps keys in the sorting state. So there is no HashMap fast.

● Set does not accept repeated elements. HashSet provides the fastest query speed. TreeSet keeps elements in the sorting state.

12. handling errors through exceptions

● The concept of java is that poorly structured Code cannot run.

●

●

●

●

●

●

●

●

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.