import java.util.HashMap; import java.util.Map; public class Test { public static void main(String[] args) { Map<String, String> hashmap = new HashMap<String, String>(); hashmap.put("1","ram"); hashmap.put("2","babu"); hashmap.put("3","rambabu"); hashmap.put("4","baburam"); for (Map.Entry<String, String> entry : hashmap.entrySet()) { System.out.println(entry.getKey() + "-" + entry.getValue()); } } }
No comments:
Post a Comment