I have a
List<String> lists;
I need to iterate through this lists and put in the LinkedHashMap
. Normally I do it as below:
Map<Integer,String> listMap=new LinkedHashMap<>();
for(int pos=0;pos<lists.size();pos++){
listMap.put(pos,lists.get(pos));
}
How can I do the above operation with streams?