I am launching in java some SQL queries, which will return some data that looks like :
[ID,Description,WhateverColumn,...,...,ImportantNumber]
Sample:
[1,"Desc",...,...,1]
[1,"Desc",...,...,2]
[1,"Desc",...,...,3]
[2,"Desc",...,...,1]
[3,"Desc",...,...,3]
[3,"Desc",...,...,5]
I am using the following List to store it in memory:
List<Object[]> myList = queryLaunched(...);
Later on, I want to do some operations with this List
of Object[]
:
[[1,"Desc",...,...,1],[1,"Desc",...,...,2],...]
and I am trying to use stream.map in the following way:
myList.stream().map(item -> System.out.println(item.toString()));
but I just receive this error:
Type mismatch: cannot convert from
Stream<Object>
tovoid
Wherever I look in google I just find samples made with List<Class>
, not with List<Object[]>
.
How could I print, and therefore, after it, start doing operations with each of the items in that list?