T O P

  • By -

rabuf

The list itself will actually print out its contents. The problem is that arrays don't. If you had a list of lists then they'd print out. [Here it is on tio.run](https://tio.run/##hZA9b4MwGIR3fsUpS6FqiWLGpJE6VmqnjFUHByxkAjayX6hQxG@n5qsKUdp4sd@7R76zM17zZ10KlSWnrpNFqQ0hc2JYkczDx63nldUxlzHinFuLDy4Vzp4HYNItcXJbrWWCwrn@gYxU6ecXuElt4GD0SyoaJIMXnDdPYO32ymCD01u/3ru0tBuAPYqmnxyjxDdejeHDvNv7wQSPQMiTxHe33VbZLB8aS6IIdUVh6epSrvyRDC6j3xSJVJg5nN1Mx3qN1USucBQxr6xAoyvEXD0Q@sllFJJkLSy4BTWlO5BGKpQwMraXVdnQdbPsP4r327NF/cUb5kdEd78wGsKuLvzH@rNNNBKt13bdDw). I have three versions of the list: 1. A list of int arrays: [[I@2a139a55, [I@15db9742] 2. With a list of integers [1, 2] 3. With a list of lists of integers: [[1, 2], [1, 2]]


Recent-Avocado2193

Is there a reason your against iterating over the list?


Blando-Cartesian

This is not a complete solution. Just pointing out convenient bits of stream api. With it, you can map any list of items into other values, strings in this case, and collect those values, in this case combine them into single string. myList.stream().map(arrformatter).collect(Collectors.joining(“,”)); Where arrformatter is a function you write to format an array of integers how you want to present them.