lombda use record

// string array is divided 
int
[] = {ARR . 1 , 2 , . 3 , . 4 }; String str1 = Arrays.stream (ARR) .boxed () Map (I -> i.ToString ()). // ordinary arrays must be boxed in order to map inside toString .collect (Collectors.joining ( "" )); String str2 .. = Arrays.stream (arr) .boxed () map (i -> i.ToString ()) the reduce ( "" , String :: concat); String str3 = Arrays.stream (arr) .boxed () the Map (Object :: toString) .reduce (. "" , String :: concat); // method reference Object :: toString

 

Guess you like

Origin www.cnblogs.com/suruozhong/p/11593521.html