This is a simple for
loop:
for (int i = new Random().nextInt(); i > 0; i--) {
// do stuff
}
More Related Contents:
- Why does this for loop work [closed]
- The syntax of the method [closed]
- Basic Looping in Java
- Nested for loop in java. Am I allowed to declare a variable in the outer and increment it in the inner?
- Why is printing “B” dramatically slower than printing “#”?
- Random shuffling of an array
- Creating random numbers with no duplicates
- Difference between declaring variables before or in loop?
- Java random numbers using a seed
- How to generate a random alpha-numeric string
- Generate a random double in a range
- How to generate a random BigInteger value in Java?
- Randomly select an item from a list
- How can I generate random number in specific range in Android? [duplicate]
- Java Generate Random Number Between Two Given Values [duplicate]
- A single-line loop with a mandatory pair of braces in Java
- Generating a Random Number between 1 and 10 Java [duplicate]
- How good is java.util.Random?
- Java: Infinite loop using Scanner in.hasNextInt()
- How can I generate a random number within a range but exclude some?
- Should I avoid using Java Label Statements?
- Breaking out of a for loop in Java [closed]
- Algorithm to generate Poisson and binomial random numbers?
- best way to pick a random subset from a collection?
- Java compressing Strings
- Generate Random Numbers in Array [duplicate]
- How to use goto statement correctly
- Java Delay/Wait
- Hibernate Criteria API: get n random rows
- Java: For-Each loop and references [duplicate]