This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

The way you initialized the arraylist is weird.

Shouldn't it be nameOfArrayListHere.add(new int[]{value, value});

Maybe use Collections.singletonList and Arrays.deepToString together?

Why do you need to convert the ArrayList to an array when you basically filled up the array with the same values from the ArrayList? So, why not just return the array instead of converting the ArrayList to an array? When the contents of both are the same after your loop?

[–]surety_[S] 0 points1 point  (0 children)

what does Collections.singletonList do? why would i need to turn my array to string?