I have an Array of strings that I want to convert in a Map. Without using AtomicInteger or third party API.
sample:
final String[] strings = new String[]{"Arsenal", "Chelsea", "Liverpool"};
final Map<Integer, String> map = new HashMap<>();
for (int i = 0; i < strings.length; i++) {
map.put(i, strings[i]);
}
System.out.println(map);
which is the best and concise way to achieve so by using streams API?