How do you update an array of 'n' elements with one operation ( order of 1 ) Note: Looping array is not a solution as you need to update all the values in single operation
Sigiloso
public static void main(String[] args) { int a[]={2,3,4}; int b[]=new int[a.length+1]; System.arraycopy(a, 0, b, 0,a.length); b[b.length-1]=5; a=null; for(int i:b){ System.out.println(i); } }