dcsimg
A school Student exam question?
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Shikha_Chauhan
Posted On:   Thursday, April 11, 2002 04:45 AM

My question is:
In what instance would one use For loop and in what instance would once use a While loop in Java programming.
What are the differences between the two?

Re: A school Student exam question?

Posted By:   Yingyi_Chu  
Posted On:   Thursday, April 18, 2002 04:12 AM

I always use forloop.
i think any logic done by whileloop can also be done by forloop

Re: A school Student exam question?

Posted By:   Bozidar_Dangubic  
Posted On:   Thursday, April 11, 2002 04:47 AM

use for loop when you know exactly how many iterations the loop will need to be executed. use while loop when you need to iterate until some condition is met.
About | Sitemap | Contact