Question: Suppose we have the following array a: int[] a = new int [] {7, 22, 19, 56, 10}; 7 [0] 22 [1] 19 56
Suppose we have the following array a: int[] a = new int [] {7, 22, 19, 56, 10}; 7 [0] 22 [1] 19 56 [2] [3] We then execute the following lines of code: Int [] b; b = a.clone(); b[2] = 0; What will be the value of a[2]? 10 [4]
Step by Step Solution
3.49 Rating (156 Votes )
There are 3 Steps involved in it
The value of a2 will remain unchanged at 19 The clone method ... View full answer
Get step-by-step solutions from verified subject matter experts
