Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java SE 综合讨论区 » Java与OOP初步  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 求教?for(;;)这个循环是什么意思啊 ?
ccecwg





发贴: 6
积分: 0
于 2006-08-08 09:49 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
for(;;){}
for(;;)这个循环是什么意思啊 ?

我弟在这先谢了


why edited on 2006-08-08 10:08

作者 Re:求教?for(;;)这个循环是什么意思啊 ? [Re:ccecwg]
jimshen





发贴: 18
积分: 2
于 2006-08-08 09:57 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
先取消使用表情标记 “禁止在这个帖子中使用笑脸标记”

是不是下面这个?

for(;;){}

无限循环,循环条件永真,如果要退出循环,需要在循环体中用break



作者 Re:求教?for(;;)这个循环是什么意思啊 ? [Re:ccecwg]
ccecwg





发贴: 6
积分: 0
于 2006-08-08 10:00 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list

俺是新来的 谢谢指教 小哥



作者 Re:求教?for(;;)这个循环是什么意思啊 ? [Re:ccecwg]
liaoyixun





发贴: 4
积分: 0
于 2006-08-13 11:31 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我也知道了,谢谢!


作者 Re:求教?for(;;)这个循环是什么意思啊 ? [Re:liaoyixun]
Jcat

熊猫的猫



发贴: 266
积分: 16
于 2006-08-13 21:02 user profilesend a private message to usersend email to Jcatsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
有这种需求,用 while(true){} 就可以了


编程,游泳,睡觉--SleepingCat
作者 Re:求教?for(;;)这个循环是什么意思啊 ? [Re:ccecwg]
awrong





发贴: 37
积分: 0
于 2006-08-19 19:37 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
传统的形式:for(初始化;条件;迭代)
可以把三个部分的任一、两部分移到()外面来;
如果全部移出来,就形成for(;; ),这样就永久不会终止的循环了。
新增的for-each:for(type itr-var:collection)



作者 Re:求教?for(;;)这个循环是什么意思啊 ? [Re:ccecwg]
metal111111





发贴: 17
积分: 0
于 2006-08-22 13:24 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
这个比while语句快0.00000...1秒,因为while(boolean)中的boolean项需要做一次判断!


java示例代码网站
http://www.javaref.cn

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923