Here is the method I came up with, please let me as it works fine or not,
public class Main {
public void extendArraySize() {
String[] names = new String[] {"c", "b", "a"};
String[] extended = new String[5];
extended[3] = "p";
extended[4] = "q";
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();
}
}