Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Java TreeMap Example NavigableMap

import java.util.*;  
class Navigable_Tree_Map{  
public static void main(String args[]){  
   NavigableMap<Integer,String> map=new TreeMap<Integer,String>();    
      map.put(93,"Afghanistan");    
      map.put(213,"Algeria");    
      map.put(55,"Brazil");    
      map.put(33,"France"); 
      map.put(49,"Germany"); 
      map.put(354,"Iceland"); 
     
      System.out.println("Navigable Map in Decending Order: "+map.descendingMap());  
  
      System.out.println("Navigable Map using headMap() method: "+map.headMap(49,true));  
  
      System.out.println("Navigable Map using tailMap() method: "+map.tailMap(49,true));
 
      System.out.println("Navigable Map using subMap() method: "+map.subMap(33, false, 55, true));   
}  
}
Comment

PREVIOUS NEXT
Code Example
Java :: find out duplicate number between 1 to n numbers in java 
Java :: webview dark mode android 
Java :: map.keyset in java 
Java :: log messages not printing in springboot using org.slf4j.Logger; 
Java :: get runtime java 
Java :: how to make a rest api in spring 
Java :: for each loop in java 
Java :: Valid regex check java 
Java :: command to create a Hashmap in Java 
Java :: processing pi 
Java :: java break string at comma 
Java :: java jbutton get background color 
Java :: how to get ascii value of string letter in java 
Java :: import image icon 
Java :: mergesort java 
Java :: Java @Deprecated annotation 
Java :: arrays vs collections 
Java :: how to add element to dictionary 
Java :: Java Change ArrayList Elements 
Java :: switch statement in java 
Java :: merge sort recursion java 
Java :: android hide and show bottom navigation 
Java :: runtime exception in java 
Java :: Add Elements in java map 
Java :: prime factors of a number 
Java :: javafx combobox cell 
Java :: Java public no-arg constructor 
Java :: repeat a string in java 
Java :: java cambiar formato de fecha 
Java :: AccountDriver.java 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =