Java示例数组扩展 Java示例扩展数组 Java示例阵列比较 Java示例数组扩展 public class Main { public void extendArraySize() { String[] names = new String[] {"Sai", "Ram", "Krishna"}; String[] extended = new String[5]; extended[3] = "Prasad"; extended[4] = "Mammahe"; System.arraycopy(names, 0, extended, 0, names.length); for (String str : extended) System.out.println(str); } public static void main(String[] args) { new Main().extendArraySize(); } } Java示例扩展数组 Java示例阵列比较