-7

What is very faster, normal {for loop} or {foreach loop} in java ?

Cœur
  • 37,241
  • 25
  • 195
  • 267
yaityaich
  • 1
  • 1
  • 3

1 Answers1

-1

They are different first of all. for-each uses Iterator under the hood whereas for is useful for operations on arrays or where you can do something meaningful with indexes.

Lucas
  • 3,181
  • 4
  • 26
  • 45