java - not to keep references to the objects from this iterator ?
大家讲道理
大家讲道理 2017-04-17 17:14:31
0
1
811

Be careful not to keep references to the objects from this iterator.
To improve GC performance the same object is re-used in next().

请问这段注释是什么含义?

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

répondre à tous(1)
阿神

下面的理解对吗?

不要保存迭代器里的对象的引用。

举个例子, iterator里面有十个对象,你用一次next,第一个就被移出了,所有执行完,迭代器为空,如果你在下面还引用这个迭代器里的对象的话,就会报空指针了

Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!