Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class Paaohjelma {
  4.  
  5. public static void main(String[] args) {
  6.  
  7. @SuppressWarnings("rawtypes")
  8. TreeMap treeMap = new TreeMap();
  9.  
  10. treeMap.put("Kimmo","Koskenkorva");
  11.  
  12. treeMap.put("Rauno","Varonen");
  13.  
  14. treeMap.put("Allu","Suomalainen");
  15.  
  16.  
  17. Collection c = treeMap.values();
  18.  
  19.  
  20. Iterator itr = c.iterator();
  21.  
  22.  
  23.  
  24. while(itr.hasNext())
  25.  
  26. System.out.println(itr.next());
  27.  
  28. }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement