Question 12
Back to Exercise
What does int[][] copy = grid.clone(); copy?
- A Every element deeply
- B Only the outer array – both copies share the same row arrays Correct
- C Nothing
- D Only the first row
Correct Answer: Option B
Changing copy[0][0] also changes grid[0][0]; clone each row for a deep copy.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!