循环问题 [英] Problem in loop

查看:62
本文介绍了循环问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我把这段代码放在这里.......问题是,这个循环只运行i = 0,我不知道是什么问题.....提前谢谢...

I am putting this code segment here.......Problem is, This loop is running only for i = 0, I dont know what is the problem.....Thanks in advance...

展开 | 选择 | Wrap | 行号

推荐答案

可能是因为Iterator中的条目数itr 。可能它只有一个条目。


你能查看实际出现的条目数吗?
It may be because of the number of entries in Iterator "itr". Probably it might have only one entry.

Can you just check on the number of entries actually present?



可能是因为Iterator中的条目数itr。可能它只有一个条目。


你能查看实际出现的条目数吗?
It may be because of the number of entries in Iterator "itr". Probably it might have only one entry.

Can you just check on the number of entries actually present?



我检查一下。迭代器有多个元素。但是当i从0变为1而while循环不再迭代时......我认为在i的变化中,while循环应该从开始.....我不知道为什么它会发生..


I check it. Iterator has more than one element. But at the change of i from 0 to 1 while loop is not iterating again......I think at the change of i while loop should start from the begining.....I dont know why its happenin..


v.size()的chech值,要么这不起作用,要么返回值为1.



while( itr.hasNext())检查itr.hasNext()的返回类型,while循环将工作直到condition为true。此条件必须返回布尔值。
chech value of the v.size(), either this is not working or returned value is 1.
or
while(itr.hasNext()) check the return type of the itr.hasNext(), while loop will work till condition is true. This condition must return the boolean value.


这篇关于循环问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆