The
concat() method of
Doubles Class in the Guava library is used to concatenate the values of many arrays into a single array. These double arrays to be concatenated are specified as parameters to this method.
For example: concat(new double[] {a, b}, new double[] {}, new double[] {c}
returns the array {a, b, c}.
Syntax:
public static double[] concat(double[]... arrays)
Parameter: This method accepts
arrays as parameter which is the double arrays to be concatenated by this method.
Return Value: This method returns a single double array which contains all the specified double array values in its original order.
Below programs illustrate the use of concat() method:
Example 1:
Output:
[1.2, 2.3, 3.5, 4.4, 5.1, 6.2, 2.1, 7.2, 0.4, 8.7]
Example 2: