Results 1 to 2 of 2
Thread: Help with for in java
- 07-13-2007, 10:08 PM #1
Member
- Join Date
- Jul 2007
- Posts
- 44
- Rep Power
- 0
- 08-07-2007, 04:38 AM #2
Member
- Join Date
- Jul 2007
- Posts
- 40
- Rep Power
- 0
If you want to execute a piece of code an exact number of times then yes a for loop would be ideal to use.
To give a more specific answer without giving the answer, here is example code of adding ten times
Greetings.Java Code:public class test { public static void main(String args[]) { int result = 0; for(int i = 0; i < 10; i++) { result++; } } }


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks