How to use java8 stream to add the same subscript values in two List < Integer > collections to generate a new List

List<Integer> list1 =Arrays.asList(1,2,3,4,5);
List<Integer> list2 =Arrays.asList(1,2,3,4,5);

as above, for two list objects, how to use the function provided by java8 stream to add the same subscript values in the two list to generate a new list
if the above two list should generate the result should be
{2Jing 4pm 8JJ 10}

Mar.13,2021

List<Integer> list1 =Arrays.asList(1,2,3,4,5);
List<Integer> list2 =Arrays.asList(1,2,3,4,5);

List<Integer> result = IntStream.range(0, list1.size())
                                .map(i -> list1.get(i) + list2.get(i))
                                .boxed()
                                .collect(Collectors.toList());
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e3e6c0-59801.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e3e6c0-59801.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?