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.
●
●
●
●
●
●
●
●