【Java HashMap,entrySet】
A memorandum of HashMap and entrySet that are often used in business.
HashMap<key, value>
Since HashMap is a generic type (generic type), the key and value types are decided and declared. The generic type limits the types that can be used.
Map key / value pairs are represented by the Map.Entry interface.
The combination of associative array keys and values is called an entry and returns a collection of Maps. It's like an array loop on a map, and it works fast.
Map.Entry is a getKey method and is a key. Get the value of value with getValue method.
It is possible to get all entry elements by using .entrySet () ;. It is possible to get all key elements by using .keySet () ;. It is possible to get all value elements by using .valueSet () ;.
Various elements are included in Object.
①+②= ArrayList<HashMap<String, Object>> → It expresses the multidimensionality of the key.
I personally find it very difficult. There are still many places where I lack knowledge, so I will do my best.
Through Java, I will learn the basics of programs and derive them into multiple languages.
Recommended Posts