Getting back primitive array after insertion into an ArrayList of primitive arrays in Java

后端 未结 4 1413
日久生厌
日久生厌 2020-12-18 17:42
List x = new ArrayList();
x.add(new double[]={1,2,3,4,54,6});  

elements 1,2,3,4,54,6 are added to x



        
4条回答
  •  青春惊慌失措
    2020-12-18 18:25

    The default toString() implementation of any Object (including the double[]) is the return of the Object address. This is what it is printed by your code.

提交回复
热议问题