java map geeksforgeeks
// Java program to demonstrate working of Map interface
import java.util.*;
class HashMapDemo
{
public static void main(String args[])
{
Map< String,Integer> hm =
new HashMap< String,Integer>();
hm.put("a", new Integer(100));
hm.put("b", new Integer(200));
hm.put("c", new Integer(300));
hm.put("d", new Integer(400));
// Returns Set view
Set< Map.Entry< String,Integer> > st = hm.entrySet();
for (Map.Entry< String,Integer> me:st)
{
System.out.print(me.getKey()+":");
System.out.println(me.getValue());
}
}
}
Also in Java:
- hashmaps java
- find maven version
- how to open a folder in java swing project
- how to create a linked list in java
- declare class variable in java
- how to read in a file in java
- Java copy file
- pascal's triangle java 2d array
- capitalize string java
- esponente in java
- change fragment in android studio
- java classes and methods simple logic with comments
- how to return the lower of two values in one line java
- how to open a webpage with java
- parsedouble java
- java round double to 2 decimal places
- java long to int
- how to minimize jframe in java
- how to remove all special characters from a string in java
- leap year checker java
- how to create a thread local variable in java
- Java nested array hashcode
- dictionary in java
- main method java