我想知道这种添加到原始数组的方法是否仍然是恒定时间?
char[] arrayA = {'b', 'c'};
char[] arrayB = ArrayUtils.add(arrayA, 0, 'a');
// arrayB: [a, b, c]
你可以在这里看看实现
基本上最后它使用复杂度为 O(n( 的System.arraycopy