Friday, 20 January 2017

TreeMap : FloorEntry


import java.util.TreeMap;

public class FloorEntry {

    public static void main(String[] args) {
        // TODO Auto-generated method stub

       

        TreeMap<Integer, Integer> lhm1 = new TreeMap<>();
        lhm1.put(10, 1);
        lhm1.put(20, 2);
        lhm1.put(40, 4);
       
        System.out.println("Full-List : "+lhm1);
               
        System.out.println("floorEntry for '12' : "+ lhm1.floorEntry(12));
       
    }
}

No comments:

Post a Comment