Tagless
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* LinkedListed
|
||||
*/
|
||||
public class LinkedListed {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Map<String, Integer> linkHashMap = new LinkedHashMap<>();
|
||||
|
||||
linkHashMap.put("AMD", 8);
|
||||
linkHashMap.put("Apple", 12);
|
||||
linkHashMap.put("Intel", 10);
|
||||
System.out.println("Our hashlinkedMap is: " + linkHashMap);
|
||||
// get the value of a key in a hashlinkedMap
|
||||
System.out.println("The CPU cores on AMD is: " + linkHashMap.get("AMD"));
|
||||
|
||||
for (Map.Entry<String, Integer> entry : linkHashMap.entrySet()) {
|
||||
System.out.println(entry.getKey() + " " + entry.getValue());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user