As a personal note
Here's how to get a HashMap with nothing in particular
HashMapSample1.java
import java.io.*;
import java.util.*
public class Sample {
public static void main(String[] args){
HashMap<Integer, String> hashMap = new HashMap <>();
for(int key : hashMap.KeySet()) {
System.out.println(hashMap.getkey));
}
}
}
How to get the value when HashMap matches in HashMap is as follows
HashMapSample2.java
import java.io.*;
import java.util.*
public class Sample {
public static void main(String[] args){
HashMap<Integer i, HashMap<String, String>> hashMap = new HashMap<>();
for(int key : hashMap) {
System.out.println(hashMap.get(key).get(target));
}
}
}
Recommended Posts