VOOZH about

URL: https://www.geeksforgeeks.org/java/java-guava-floats-concat-method-with-examples/

⇱ Java Guava | Floats.concat() method with Examples - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Java Guava | Floats.concat() method with Examples

Last Updated : 11 Jul, 2025
The concat() method of Floats Class in the Guava library is used to concatenate the values of many arrays into a single array. These float arrays to be concatenated are specified as parameters to this method.
For example: concat(new float[] {a, b}, new float[] {}, new float[] {c} returns the array {a, b, c}.
Syntax:
public static float[] concat(float[]... arrays)
Parameter: This method accepts arrays as parameter which is the float arrays to be concatenated by this method. Return Value: This method returns a single float array which contains all the specified float 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:
Output:
[1.2, 2.3, 3.4, 4.5, 5.6, 6.4, 7.6, 8.7, 9.7, 0.8]
Reference : https://guava.dev/releases/19.0/api/docs/com/google/common/primitives/Floats.html#concat(float%5B%5D...)
Comment