Advertisement
Guest User

Untitled

a guest
Aug 31st, 2015
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. public class NewClass1 {
  2.  
  3. public static void main(String[] args) {
  4. Map<Integer, String> testMap = new HashMap<Integer, String>();
  5. testMap.put(10, "a");
  6. testMap.put(20, "b");
  7. testMap.put(30, "c");
  8. testMap.put(40, "d");
  9. for (Entry<Integer, String> entry : testMap.entrySet()) {
  10. if (entry.getValue().equals("c")) {
  11. System.out.println(entry.getKey());
  12. }
  13. }
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement