Q. What is the correct way to copy the elements of one array to another in Java?

  • (A) Use a for loop to iterate through the elements and copy them one by one.
  • (B) Use the clone() method of arrays.
  • (C) Use the copy() method of arrays.
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) Use a for loop to iterate through the elements and copy them one by one.

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
117
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Vikash Gupta
Publisher
πŸ“ˆ
82%
Success Rate