Ints concat() function | Guava | Java Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report Guava's Ints.concat() method is used to combine the arrays passed as parameters into a single array. This method returns the values from each provided array combined into a single array. For example, concat(new int[] {a, b}, new int[] {}, new int[] {c} returns the array {a, b, c}. Syntax: public static int[] concat(int[]... arrays) Parameters: This method takes arrays as parameter which represents zero or more int arrays. Return Value: This method returns a single array containing all the values from the source arrays, in order. Example 1: Java // Java code to show implementation of // Guava's Ints.concat() method import com.google.common.primitives.Ints; import java.util.Arrays; class GFG { // Driver's code public static void main(String[] args) { // Creating 2 Integer arrays int[] arr1 = { 1, 2, 3, 4, 5 }; int[] arr2 = { 6, 2, 7, 0, 8 }; // Using Ints.concat() method to combine // elements from both arrays into a single array int[] res = Ints.concat(arr1, arr2); // Displaying the single combined array System.out.println("Combined Array: " + Arrays.toString(res)); } } Output: Combined Array: [1, 2, 3, 4, 5, 6, 2, 7, 0, 8] Example 2: Java // Java code to show implementation of // Guava's Ints.concat() method import com.google.common.primitives.Ints; import java.util.Arrays; class GFG { // Driver's code public static void main(String[] args) { // Creating 4 Integer arrays int[] arr1 = { 1, 2, 3 }; int[] arr2 = { 4, 5 }; int[] arr3 = { 6, 7, 8 }; int[] arr4 = { 9, 0 }; // Using Ints.concat() method to combine // elements from both arrays into a single array int[] res = Ints.concat(arr1, arr2, arr3, arr4); // Displaying the single combined array System.out.println("Combined Array: " + Arrays.toString(res)); } } Output: Combined Array: [1, 2, 3, 4, 5, 6, 7, 8, 9, 0] Reference: https://guava.dev/releases/22.0/api/docs/com/google/common/primitives/Ints.html#concat-int:A...- Comment More infoAdvertise with us Next Article IntStream concat() in Java S Sahil_Bansall Follow Improve Article Tags : Java java-guava Practice Tags : Java Similar Reads Guava's Ints.join() Function in Java Ints.join() function provided by Guava library in Java for working with primitive integer arrays. It simplifies the process of converting an array of integers into a single concatenated string, with a specified delimiter separating the elements. For example, join("-", 1, 2, 3) returns the string "1- 2 min read Guava's Ints.join() Function in Java Ints.join() function provided by Guava library in Java for working with primitive integer arrays. It simplifies the process of converting an array of integers into a single concatenated string, with a specified delimiter separating the elements. For example, join("-", 1, 2, 3) returns the string "1- 2 min read Guava's Ints.join() Function in Java Ints.join() function provided by Guava library in Java for working with primitive integer arrays. It simplifies the process of converting an array of integers into a single concatenated string, with a specified delimiter separating the elements. For example, join("-", 1, 2, 3) returns the string "1- 2 min read IntStream concat() in Java IntStream concat() method creates a concatenated stream in which the elements are all the elements of the first stream followed by all the elements of the second stream. The resulting stream is ordered if both of the input streams are ordered, and parallel if either of the input streams is parallel. 2 min read Ints Class | Guava | Java Ints is a utility class for primitive type int. It provides Static utility methods pertaining to int primitives, that are not already found in either Integer or Arrays. Declaration : @GwtCompatible(emulated=true) public final class Ints extends Object Below table shows the Field summary for Guava In 3 min read Stream.concat() in Java Stream.concat() method creates a concatenated stream in which the elements are all the elements of the first stream followed by all the elements of the second stream. The resulting stream is ordered if both of the input streams are ordered, and parallel if either of the input streams is parallel. Sy 4 min read Like