I have LinkedHashMap returning from DB. From this map I need to get the last key. If I get all keys using keySet method it returns Set of keys but Set does not guarantee the order. I need to take exactly last key from the LinkedHashMap returned from DB. How can I do that ?
Below is the code how I get data from database.
LinkedHashMap<String,String> map = someDao.getMap(String input);
From this map I need to take last key.