Home > Back-end >  /don't understand, ask for each cycle and the difference between an iterator
/don't understand, ask for each cycle and the difference between an iterator

Time:09-20

Today see a video about the Iterator Iterator, want to ask next made traversal and Iterator for each have what distinction,

Online said for each data type limitation, but if I write:

For (Object x: arr) {
System. The out. Println (x);
}

So not data types not limited??
Why use iterator
?Don't understand...
O great god answer

CodePudding user response:

In an iterator,

CodePudding user response:

For each cycle of the underlying code is to use an iterator

CodePudding user response:

For each is to use an iterator

CodePudding user response:

See their habits, it is not necessary to do comparison,
Upstairs say yes, will be optimized for each iterator, decompiled see to know,

CodePudding user response:

Thank you for your

CodePudding user response:

If a pure traversal, fluidization, I suggest you to process the data in the stream safer than you use iterator processing
  • Related