File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes loops Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "loops" Watch "loops" New topic


jandost khoso

Joined: Nov 26, 2001
Posts: 6
hi friends. i had a question that which one is more efficient:
for loop or while loop why?
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
This has been discussed several times in the "performance" forum and the summary is : there is no basic difference in speed. Therefore make your choice based on function.

"JavaRanch, where the deer and the Certified play" - David O'Meara
I agree. Here's the link:
subject: loops
It's not a secret anymore!