Java NavigableMap create via TreeMap

Description

Java NavigableMap create via TreeMap

import java.util.NavigableMap;
import java.util.TreeMap;

public class Main {
  public static void main(String[] args) {
    NavigableMap<Integer, String> map = new TreeMap<Integer, String>();
    map.put(1, "CSS");
    map.put(2, "HTML");
    map.put(3, "Java");
    map.put(4, "Javascript");
    map.put(5, "SQL");

    System.out.println(map);/*  w w  w .  j av a 2s  .c om*/
    System.out.println(map.subMap(4, true, 5, true).values());
    
    
  }
}



PreviousNext

Related