Java HashMap, entrySet [Personal memo]

【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 entrySet method is a Map class method

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 () ;.

・ Example of actual use

① HashMap <String, Object> One-to-one correspondence

Various elements are included in Object.

(2) ArrayList Stores a list of character string values

①+②= ArrayList<HashMap<String, Object>> → It expresses the multidimensionality of the key.

Digression

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

Java HashMap, entrySet [Personal memo]
Java memo
java anything memo
Java Silver memo
Java HashMap class
[Personal memo] Java data type is annoying
Java SE 7 memo
java anything memo 2
[Personal memo] Java development environment is ready
Java specification memo
Display message dialog in java (personal memo)
Java pattern memo
Java development environment memo
[Personal memo] try-catch summary
java basic knowledge memo
Java learning memo (method)
Java Kuche Day memo
[Java ~ Method ~] Study memo (5)
java se 8 programmer Ⅰ memo
Java paid private memo
Java static [Personal summary]
[Java ~ Array ~] Study memo 4
Java learning memo (basic)
(Memo) Java for statement
Personal summary about Java
Java lambda expression [memo]
Java learning memo (interface)
Java learning memo (inheritance)
[Memo] Java Linked List
[Personal memo] Make a simple deep copy in Java
Learning memo when learning Java for the first time (personal learning memo)
Java (WebSphere Application Server) memo [1]
[Personal memo] About Spring framework
[Java] Variable name naming memo
Java memo (standard class) substring
Java learning memo (data type)
Personal comment criteria [Java edition]
Java memo (standard class) length
[Personal memo] Frequently used Java grammar updated from time to time
Java Silver Study Method Memo
Personal memo Progate Ruby I (2)
[Java ~ Boolean value ~] Study memo (2)
Create a java method [Memo] [java11]
Java Silver exam preparation memo
[Swift] Closure basics (personal memo)
Personal memo Eclipse plug-in installation
Java learning memo (logical operator)
Java learning memo (abstract class)
[Java] Date Related Term Memo
Java study memo 2 with Progate
[Personal memo] Number guessing game
Personal memo Lombok's typical annotation
What are Java metrics? _Memo_20200818
[Eclipse Java] Development environment setting memo
Truffle Tutorial Slides Personal translation memo ①
[Java] Difference between Hashmap and HashTable
Java learning memo (creating an array)
JCA (Java Cryptography Architecture) Usage Memo
[Java] Memo for naming class names
[Study session memo] Java Day Tokyo 2017
Java learning memo (while statement, do-while statement)