String[] a = { "0", "1", "2" }; String[] b = { "0", "1", "2" }; List list = new ArrayList(Arrays.asList(a)); list.addAll(Arrays.asList(b)); String[] aa= new String[list.size()]; list.toArray(aa); Arrays.sort(aa); System.out.println(Arrays.toString(aa));