Home > Back-end > Long array to turn a list of questions, for help
Long array to turn a list of questions, for help
Time:10-27
Public static void main (String [] args) { Arr=new long long [] [] 11,41,31,31} {; //List List=Longs. AsList (arr); //the List List=Arrays. The stream (arr) boxed () collect (Collectors. ToList ()); List the List=Arrays. AsList (arr); System. The out. Println (list. Get (0)); }
Desired output first element 11, but the actual output is [J @ 1 c4af82c, I know the List can only add the packing type or a reference type, need to do to output 11? Great god answer, thank you!
CodePudding user response:
The toString ();
CodePudding user response:
You can refer to
Long [] arr={Long. The valueOf (11), and Long. The valueOf (41), Long. The valueOf (31), and Long. The valueOf (31)}; List List=Arrays. AsList (arr);
System. The out. Println (arr [0]). System. The out. Println (list. Get (0));