A

Admin • 833.24K Points
Coach

Q. Which loop is preferred when you need both index and value from an array?

  • (A) for-each
  • (B) while
  • (C) for loop with index
  • (D) do-while
  • Correct Answer - Option(C)
  • Views: 29
  • Filed under category Java
  • Hashtags: Java Array

Explanation by: Admin

Only a traditional for loop gives access to both index and value.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.