Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Java treemap

import java.util.*;  
class Tree_Map{  
public static void main(String args[]){  
   TreeMap<Integer,String> map=new TreeMap<Integer,String>();    
      map.put(93,"Afghanistan");    
      map.put(213,"Algeria");    
      map.put(55,"Brazil");       
        
      for(Map.Entry mapTree:map.entrySet()){    
       System.out.println(mapTree.getKey()+" "+mapTree.getValue());    
      }    
}  
}
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Java #treemap
ADD COMMENT
Topic
Name
1+5 =