for
while
do
使用忽略增强的 for 循环选项来忽略 foreach 循环。 它们有时用于以紧凑的方式仅对可迭代对象的第一项执行操作。
示例:
for (String s : stringIterable) { doSomethingOnFirstString(s); break; }