Skip to content
Advertisement

Converting List to TreeMap java lambda

I’m trying to convert a List<String> to a TreeMap<Long, CustomClass> The key is the same as the list items but just parsed to Long, the value is just a call to new CustomClass(). How can I achieve this using lambda functions?

JavaScript

the above code errors out, with the following error,

JavaScript

Advertisement

Answer

For example:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement