This article explores different ways to combine two arrays of different types into an object array in Kotlin. The new object new array should contain all the first array elements, followed by all the elements second array.

1. Using Stream.concat() function

Download Code

2. Using System.arraycopy() function

Download Code

3. Using MutableList

Download Code

 
The above code is short for the following:

Download Code

That’s all about combining two arrays of different types in Kotlin.