I\'m looking to replace the following for loop with an elegant java 8 stream or lambda solution. Is there anything concise and efficient?
public static v
Yes you can achieve this using this line of code:
IntStream.range(1,myList.size()) .forEachOrdered(i->myList.set(i,(myList.get(i)+myList.get(i-1)/2))); System.out.println(myList);