Java random, various processing

--Simple random numbers

new Random().nextXxx();
new Random().nextXxx(10);

--Non-duplicate random number list

new Random().ints(0, Integer.MAX_VALUE)
    .distinct()
    .limit(10)
    .boxed()
    .collect(Collectors.toList())

--List random number acquisition

list.get(random.nextInt(list.size()));

Recommended Posts

Java random, various processing
java (random number)
Java thread processing
Java string processing
[Java] Multi-thread processing
[Java] Random method
[Java] Stream processing
java iterative processing
Parallel and parallel processing in various languages (Java edition)
JAVA constructor call processing
[Java] Multi-thread processing --Exclusive control
[Java] Stream API --Stream termination processing
[Java] Stream API --Stream intermediate processing
[Java] Timer processing implementation method
[Java] Random number generation method (Random)
Measured parallel processing in Java
Understanding Java Concurrent Processing (Introduction)
Summary of java error processing
Java Learning 1 (learning various data types)
Various methods of Java String class
Date processing in Java (LocalDate: Initialization)
[Java] Loop processing and multiplication table
Run node.js from android java (processing)
[Processing × Java] How to use variables
Server processing with Java (Introduction part.1)
Surprisingly deep Java list inversion-Stream processing
Basic processing flow of java Stream
About file copy processing in Java
Notes on Android (java) thread processing
Java
Deleting files using recursive processing [Java]
[Processing × Java] How to use arrays
[Java] Processing time measurement method memo
[Java] Exception types and basic processing
Data processing using stream API from Java 8
[Processing x Java] Construction of development environment
Various things like bit flags in Java
[Processing × Java] How to use the loop
[Beginner] Various iterative processing for Ruby arrays
Try various Java Stream API methods (now)
Let's summarize JavaScript, PHP, Java random functions
[Processing × Java] How to use the class
[Processing × Java] How to use the function
[Java ~ Conditional branching / Iterative processing ~] Study memo (3)
[Java] Various methods to acquire the value stored in List by iterative processing