Home > Back-end >  Enhanced for loop
Enhanced for loop

Time:05-26

Someone told me that enhanced for loop changes within just copy but it running as a result I printed copy is

CodePudding user response:

And the normal cycle without distinction

CodePudding user response:

Through with this man, big suddenly
Enhanced for loop compiled in fact or iterator, certainly can modify the element, just can't remove elements, can cause abnormal synchronous change counter count inconsistent,

CodePudding user response:

Dear John,
Are made with reference to the modification, reference points to the real object
  • Related