Created
January 5, 2019 17:02
-
-
Save RashidJorvee/5a9893017b70e52919070ebbff962e90 to your computer and use it in GitHub Desktop.
How to generate and get a random number in Java?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package rashid.jorvee; | |
import java.lang.Math; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
public class GenerateRandomNumber { | |
public static void main(String[] args) { | |
ArrayList<Integer> list = new ArrayList<Integer>(); | |
for (int i=0; i<245; i++) { | |
list.add(i); | |
} | |
Collections.shuffle(list); | |
for (int i=0; i<245; i++) { | |
System.out.println("Value::"+list.get(i)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment