今天看别人的代码引用了这个函数,发现原来遍历数组(非List,例如:int [][] 类型等)可以直接调用Arrays.deepToString(数组名)可以直接输出结果,以前还傻不啦叽的的转换成List数组或者是for循环遍历。
Integer[][] allMovieCommentList 。。。;
String deepToString = Arrays.deepToString(allMovieCommentList);
输出:
结果:
[[1, 0, 1, 1, 1], [1, 1, 0, 1, 1], [1, 1, 1, 1, 0], [0, 0, 1, 1, 1], [1, 0, 1, 1, 0], [0, 1, 1, 0, 1], [0, 0, 1, 0, 1]]