Given the array of integers ‘array’ shown below :
13, 7, 27, 2, 18, 33, 9, 11, 22, 8.
What is the output of the following JAVA statements ?
int [ ] p = new int [10];
int [ ] q = new int [10];
for (int k = 0; k < 10; k ++)
p[k] = array [k];
q = p;
p[4] = 20;
System.out.println(array [4] + “ : ” + q[4]);
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy