Hi All,
Here I write a program for Merge two array values using java.
import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class mergeArray { public static void main(String args[]) { String x[] = { "S", "K", "i" }; String y[] = { "T", "E","C","H" }; List list = new ArrayList(Arrays.asList(x)); list.addAll(Arrays.asList(y)); Object[] z = list.toArray();
System.out.println("Merge two array result \n "+Arrays.toString(z)); } }
Output
~~~~~~
Merge two array result
[S, K, i, T, E, C, H]
No comments:
Post a Comment