Answers for "floorentry in treemap"

1

TreeMap floorEntry() method in java

import java.util.TreeMap;
public class TreeMapFloorEntryMethodExample
{
   public static void main(String[] args)
   {
      TreeMap<Integer, String> tm = new TreeMap<Integer, String>();
      tm.put(63, "orange");
      tm.put(50, "apple");
      tm.put(83, "watermelon");
      tm.put(86, "banana");
      tm.put(56, "mango");
      System.out.println("Check floor entry for 86: ");
      System.out.println("Value is: " + tm.floorEntry(86));
   }
}
Posted by: Guest on October-28-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language