1, at the time of the Guide package can import its static part, so that in the class to use it, you can directly use its name
For example: Map.entry access, after the class file header imports import Java.util.Map.Entry after simplification for entry.
2. You can use the modifier to return a value type method name ( parameter type ...). formal parameter name ) {}" to pass in an indeterminate number at the same time, parameters of the same parameter type. For example, when the data of an int of an indeterminate number is obtained, this method can be used to avoid writing multiple methods, which cannot be overloaded if the parameter type does not change, because the variable parameter does not determine the number of parameters. To increase the immutable parameters, you need to add them before the variable parameters in the parameter list. mutable parameters are only available after Java1.5.
3. Common methods of collections collection tools
Collections.shuffle (list<?> list)//randomly arranges the elements in the list.
Collections.sort(list<?> List)//The elements are sorted in ascending order according to their natural sequence.
4, set nesting, common nested forms:
(1) ArrayList nested ArrayList,
(2) Map nesting ArrayList
(3) Map set nesting
Java Basics Review-22 (static import, variable parameters, collections Collection Tool class, set nesting)